Dysan Posted November 22, 2007 Share Posted November 22, 2007 How do I search an array for a certain value?.... ...and if successful, display "Value Found" else display "Value Not Found"? Quote Link to comment Share on other sites More sharing options...
trq Posted November 22, 2007 Share Posted November 22, 2007 <?php $a = array('foo','bar'); if (in_array('bar',$a)) { echo "Value found"; } else { echo "Value not found"; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.