Or the Cake way: http://book.cakephp.org/view/666/diff

$missing_numbers = Set::diff($the:array, $the_complete_array);



On 4 Aug., 11:36, Fran Iglesias <[email protected]> wrote:
> You could try
>
> $missing_numbers = array_diff($the_array, $the_complete_array);
>
> El 04/08/2009, a las 9:57, liaogz82 escribió:
>
>
>
>
>
> > Hi all,
>
> > I know this is not directly related to cakePHP but i am cracking my
> > head trying my best to figure out how to discover a missing number in
> > an array in php.
>
> > Let me give you this example:
> > $missing_array1 = array(1,2,3,4,6,7,8);
>
> > The missing number for the above array is 5.
>
> > $missing_array2 = array(1,2,3,4,5,7,8,9);
>
> > The missing number is 6
>
> > Please help me on this. Thanks
>
> > Gangzheng
>
> ---
> Fran Iglesias <[email protected]>http://cakephpilia.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to