Fwd: [PHP] Help on number matching function

2011-09-17 Thread tamouse mailing lists
 Notice: This communication, including attachments, may contain
 information that is confidential. It constitutes non-public information
 intended to be conveyed only to the designated recipient(s). If the
 reader or recipient of this communication is not the intended
 recipient, an employee or agent of the intended recipient who is
 responsible for delivering it to the intended recipient, or if you
 believe that you have received this communication in error, please
 notify the sender immediately by return e-mail and promptly delete
 this e-mail, including attachments without reading or saving them
 in any manner. The unauthorized use, dissemination, distribution,
 or reproduction of this e-mail, including attachments, is prohibited
 and may be unlawful. If you have received this email in error,
 please notify us immediately by e-mail or telephone and delete the
 e-mail and the attachments (if any).

Not another one...

Sending e-mail to a public mailing list MUST be intended for the public.

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



[PHP] Help on number matching function

2011-09-16 Thread Dare Williams
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.


Re: [PHP] Help on number matching function

2011-09-16 Thread Robert Williams
On Sep 16, 2011, at 6:02, Dare Williams darrenwi...@yahoo.com wrote:


  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.


Check out array_intersect().

http://us.php.net/manual/en/function.array-intersect.php

--
Bob Williams

Notice: This communication, including attachments, may contain information that 
is confidential. It constitutes non-public information intended to be conveyed 
only to the designated recipient(s). If the reader or recipient of this 
communication is not the intended recipient, an employee or agent of the 
intended recipient who is responsible for delivering it to the intended 
recipient, or if you believe that you have received this communication in 
error, please notify the sender immediately by return e-mail and promptly 
delete this e-mail, including attachments without reading or saving them in any 
manner. The unauthorized use, dissemination, distribution, or reproduction of 
this e-mail, including attachments, is prohibited and may be unlawful. If you 
have received this email in error, please notify us immediately by e-mail or 
telephone and delete the e-mail and the attachments (if any).

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



Re: [PHP] Help on number matching function

2011-09-16 Thread Ken Robinson

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



Re: [PHP] Help on number matching function

2011-09-16 Thread Andre Polykanine

Hello Dare,

  

DW I need a Function of any category in  either PHP or MySQL RDBMS
DW customize Function, Class, Methods or anything that could help me
DW compare a particular set of number and return their matching
DW result.

consider using array_intersect().


-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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



Re: [PHP] Help on number matching function

2011-09-16 Thread Mattias Thorslund
If one or both of your data sets are in MySQL already, there may be no 
need to do the comparison in PHP. Just use IN() or INNER JOIN. Or is 
there some particular reason why neither of these will work in your case?


Cheers,

Mattias

On 09/16/2011 05:36 AM, 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.





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