Re: Help on number matching function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 08:36 AM 9/16/2011, Dare Williams wrote:
Dear PHP Group, I need a Function of any category in either PHP or MySQL RDBMS customize Function, Class, Methods or anything that could help me compare a particular set of number and return their matching result. e.g If I have a 5 Digits set of number and need to match it with another set of five digits and return how many number are match and the figures that are match. 1. (62,39,47,25,14) - (14,39,62,25,47) - match 5 (all) 2. (55,11,27,62,39) - (66,39,12,13,27) - match 2 (27,39) 3. (20,04,56,17,16) - (16,01,17,04,79) - match 3 (16,17,04) Any Help will be appreciated. Thank you.

Turn your sets of number into an array and then use the function array_intersect, http://php.net/array_intersect

Ken



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux