Search Array





4
Date Submitted Fri. Jun. 9th, 2006 11:40 AM
Revision 1 of 1
Coder mattrmiller
Tags Array | find | PHP | search
Comments 0 comments
A simple search array example.


$aArray = array("Apple", "Pear", "Lemon", "Orange");
if (in_array("Pear", $aArray))
{
        echo "Got Pear";
}
if (in_array("Lemon", $aArray))
{
        echo "Got Lemon";
}

 

Matthew R. Miller

www.bluecreststudios.com
=================
Matthew R. Miller

http://bluecreststudios.com
http://www.codeandcoffee.com

Comments

There are currently no comments for this snippet.

Voting