Re: Re: If I have 2 arrays...

From: Date: Thu, 16 Jun 2005 17:14:30 +0000
Subject: Re: Re: If I have 2 arrays...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-217089@lists.php.net to get a copy of this message
Jay Blanchard wrote:
[snip] Close... I think array keys are preserved from the (original) first array, but other than that those appear to be the values that should intersect. [/snip] After a var_dump I am seeing that there is an extra space in each element of one array, so no intersection occurs.
Well then there you have it... having an extra space means that the strings in the first array won't match the strings in the second array. Perhaps you can array_intersect(array_walk($array1, 'trim'), $array2) -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php

« previous php.general (#217089) next »