MDanz Posted March 10, 2011 Share Posted March 10, 2011 $c = "non-specific"; $categoryex = explode(", ",$c); $category = "non-specific"; if(array_key_exists('$category', $categoryex)) { echo "yes"; } it should echo yes because $category='non-specific' and 'non-specific' is in the array... Link to comment https://forums.phpfreaks.com/topic/230248-array_key_exist-help/ Share on other sites More sharing options...
MDanz Posted March 10, 2011 Author Share Posted March 10, 2011 nevermind found out to use in_array() and i put apostrohes around $category.. Link to comment https://forums.phpfreaks.com/topic/230248-array_key_exist-help/#findComment-1185728 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.