I have an array built using the following from a query:
while ($row=mysql_fetch_row($dbResult)) {
$ttl[] = array($row[0],$row[1],$row[2],$row[3],$row[4],$row[5]);
}
The values in the array are numeric and I'm tyring to look up the string value of a particular array element in a separate array built with the following:
while ($row=mysql_fetch_row($dbResult)) {
$div[] = array($row[0],$row[1]);
}
I'm trying to use array_search() to locate the values but having no such luck.
I have tried a piece of code I found here using list and each, however it only produces an infinite loop since value is always type array.
function TravelArray( $array, $needle )
{
global $key;
while(list ($key, $value) = each ($array)) {
if(is_array( $value )) {
TravelArray( $array );
}
else {
return($key);
}
}
}
Any help would be greatly appreciated as I'm just stuck.
Thanks,