[Solved] PHP in array not working
The reason I can think of why this returns ERROR: if (in_array(array(‘string’, ‘id’), array(‘string’, ‘id’))) { echo ‘IN ARRAY’; } else { echo ‘ERROR!’; } is because PHP is checking each of the haystack’s values against the needle itself. Suppose you have 2 arrays like so: $a = array(‘string’, ‘id’); $b = array(‘string’, ‘id’); $a … Read more