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" Quote 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 Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.