Re: some array help :)

From: Date: Sat, 10 Mar 2001 15:58:49 +0000
Subject: Re: some array help :)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43317@lists.php.net to get a copy of this message
Or you could use this in php4: if ( in_array( "something", $temparray )) { do stuff } -J ----- Original Message ----- From: "rm" <richand2002@yahoo.com> To: <php-general@lists.php.net> Sent: Saturday, March 10, 2001 4:54 PM Subject: Re: [PHP] some array help :) > I'm not exactly sure of what you're doing, however, if > you're trying to find a match to an element of an > array and if there's a match do something....you might > try.... > > for ($i=0; $i < count($temparray); $i++){ > > if ($temparray[$i] == "something"){ > do whatever this and that; > } > } > > rm > --- Gregor Jaksa <gre-gor@delphi-si.com> wrote: > > hello, > > > > i'm trying to do something like > > > > $tmparray = array("foo", "foo1", "foo2"); > > if ($i in $tmparray) then do something > > .. > > but i dont know how to do it. > > any help would be appriciated > > > > > > > > -- > > 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 > > > > > ===== > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - Buy the things you want at great prices. > http://auctions.yahoo.com/ > > -- > 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 >

« previous php.general (#43317) next »