finding key position of specified value in multi-dimensional array

Posted on 16th Feb 2014 by admin

Code: $openedfile = fopen($tfc_file4, "r");
$rc = 1;
while(!feof($openedfile))
{
$rc++;
$hold[$rc] = explode("|" , trim(fgets($openedfile)));
}
fclose($openedfile);
How can I loop through each $hold[$rc] and check if there is an $x_value in that particular array? Also- if there is an $x_value then need to know the what array in $hold has it?

So the loop through would tell me that $x_value is located in $hold[2] - for example. While it's exact position may be in $hold[2][4] - I do not need to know that.

Any help would be appreciated.
Melting.......

Other forums