Re: checking values between arrays
| From: | Egon Schmid | Date: | Fri, 07 Jul 2000 13:47:48 +0000 |
| Subject: | Re: checking values between arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5379@lists.php.net to get a copy of this message | ||
Mike Bosschaert wrote:
>
> Where did you find this function??
> And are there more of these hidden functions?
> Mike
Andrei is the author of the array_*() functions. Try Hartmut's functions
table http://www.zugeschaut-und-mitgebaut.de/php/a.html
and you will
see, it is not yet documented by an author of the PHP manual. I guess it
would be the same person.
-Egon
> Andrei Zmievski <andrei@ispi.net> on 07-07-2000 15:37:21
>
> To: "Thomas Edison Jr." <thomasedisonjr@yahoo.com>
> cc: php-general@lists.php.net (bcc: Mike Bosschaert/YEU/Yakult WW)
>
> Subject: Re: [PHP] [PHP-GENERAL] checking values between arrays
>
> On Fri, 07 Jul 2000, Thomas Edison Jr. wrote:
> > I got two arrays, both has got some words in different
> > locations, how do i check wether any of the words in
> > any location of the first array exist in any location
> > of the second array?
> >
> > I tried running both arrays in multiple loops and
> > putting an if condition, but it checks for only one
> > word. If there are two common words, it doesn't give
> > correct answer.
>
> Try array_intersect() function.
>
> <?
> $a1 = array('red', 'green', 'blue');
> $a2 = array('green', 'yellow', 'ochre');
> $result = array_intersect($a1, $a2);
> ?>
>
> $result should be array('green').
>
> -Andrei
> * Life may be expensive, but it includes an annual free trip around the sun. *
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
SIX Offene Systeme GmbH · Stuttgart - Berlin - New York
Sielminger Straße 63 · D-70771 Leinfelden-Echterdingen
Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de
PHP-Stand auf Europas grösster Linux-Messe: 'LinuxTag 2000'
weitere Infos @ http://www.dynamic-webpages.de/