My following code works (it returns the value of text in 2d array). Now, this is just a proof of concept for something more I want to do (so that's why the logic is stupid)
function searchArrayFor($array, $id, $searchFor) {
$index = 0;
foreach ($array as $key => $value)
{
return $value[1];
}
}
So I noticed in my log file, that I am constantly getting "PHP Warning: Invalid argument supplied for foreach()". Everything looks right, and returns the value I want, any ideas on why I keep getting this error? I really don't want to be spamming the log file with every page load.
using PHP version 5.3.28 (I know, really old version).
Thanks