wannabe_god Posted June 7, 2006 Share Posted June 7, 2006 with array_search you can search an array...so <?php$array=array("test1","test2","test3");echo array_search("test2",$array);?> will give 2.But i just want to check if "test2" is in the array $array. True or false, not a key...something like <?php$array=array("test1","test2","test3","test4");if value_is_in_array("test5") //I don't know the functionecho "test5 is in the array"elseecho "test5 is not in the array"?> Link to comment Share on other sites More sharing options...
justsomeguy Posted June 7, 2006 Share Posted June 7, 2006 http://www.php.net/manual/en/function.in-array.phpUse the reference, Luke.http://www.php.net/manual/en/ref.array.php Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now