johnsmith153 Posted September 4, 2008 Share Posted September 4, 2008 Obviously this doesnt work. What would? $arrayname = array(); $arrayname[]="1"; $arrayname[]="4"; $arrayname[]="6"; if(value_exists("4", $arrayname)) { echo "yes"; } This Returns "yes" Link to comment https://forums.phpfreaks.com/topic/122738-ultra-simple-what-array-checks-if-value-exists/ Share on other sites More sharing options...
johnsmith153 Posted September 4, 2008 Author Share Posted September 4, 2008 in_array Link to comment https://forums.phpfreaks.com/topic/122738-ultra-simple-what-array-checks-if-value-exists/#findComment-633821 Share on other sites More sharing options...
wildteen88 Posted September 4, 2008 Share Posted September 4, 2008 in_array You've just answered your own question! Link to comment https://forums.phpfreaks.com/topic/122738-ultra-simple-what-array-checks-if-value-exists/#findComment-633829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.