Reply to Re: [PHP] Re: If I have 2 arrays...

Your name:

Reply:


Posted by Jason Barnett on 06/16/05 20:14

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация