johnsmith153 Posted September 30, 2008 Share Posted September 30, 2008 I.e $array[0]="jim smith"; if($array[0] holds the value of "smith"){echo "yes";}else{echo "no";} "yes" Link to comment https://forums.phpfreaks.com/topic/126382-solved-can-i-check-if-an-array-contains-set-text/ Share on other sites More sharing options...
Guest Xanza Posted September 30, 2008 Share Posted September 30, 2008 $names = array("fname" => "jim", "lname" => "gold"); if(array_values($names) == "jim"){ echo "Yes"; } else { echo "No"; } Give that a try. Link to comment https://forums.phpfreaks.com/topic/126382-solved-can-i-check-if-an-array-contains-set-text/#findComment-653540 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.