Mutley Posted May 17, 2009 Share Posted May 17, 2009 Simple concept, just can't find the function for it. $word = 'melon'; $list = array('apple', 'peach', 'carrot', 'lemon'); if($word == $list){ // But this wouldn't work, I presume I need a function to check the words in the array? echo 'yes'; }else{ echo 'no'; } Thanks in advance, Nick. Link to comment https://forums.phpfreaks.com/topic/158469-solved-if-word-matches-on-in-array/ Share on other sites More sharing options...
Dathremar Posted May 17, 2009 Share Posted May 17, 2009 This is what You are looking for http://www.php.net/manual/en/function.in-array.php Link to comment https://forums.phpfreaks.com/topic/158469-solved-if-word-matches-on-in-array/#findComment-835752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.