Or you could use this in php4:
if ( in_array( "something", $temparray )) { do stuff }
-J
----- Original Message -----
From: "rm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]> 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:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> =====
>
>
> __________________________________________________
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]