Hi. I have a two dimentional array that contains a lot of values, numbers mostly. Is there a function I can use to find out whether the array contains a certain number or not? Or do I have to loop through it and check every element of the array?
http://www.php.net/manual/en/function.in-array.php
try also this for php <4.0.5
function array_search($str, $vars) { foreach ($vars as $key => $val) { if ($val == $str) { return $key; } } }
or use the implemented function in php versions above