finding key position of specified value in multi-dimensional array


Posted on 16th Feb 2014 07:03 pm by admin

Code: $openedfile = fopen($tfc_file4, "r");
$rc = 1;
while(!feof($openedfile))
{
Did you know?Explore Trending and Topic pages for more stories like this.
$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.......
No comments posted yet

Your Answer:

Login to answer
302 Like 40 Dislike
Previous forums Next forums
Other forums

if statements problems
Hi. I'm trying to make a web form, but I kind of hit a dead end trying to figure out why it doesn't

Saving PHP output as a file
I wondered if anyone knows how to save the rendered output of a PHP script as a file?

I have

Random Number Generation And Probability
Hello, I am working on a function which has to insert data into a SQL table.

we have to suppl

WHYISNT THIS MYSQL STATEMNT NOT WORKING? (php)
caps because its absolutely rediculous.
i dontunderstand why its not working. there is a column c

Serial number of exernal hard disk/Thumbdrive
Hi guys, I am new tio java networking concepts.Please tel me how to get Serial number of exernal

problems with contact forms that are only protected against SQL injections
What could be a potential problem with contact forms that are only protected against SQL injections

Easy administration on MySQL databases
My website is database driven and I am very tired of manually making queries to my tables in order t

Extracting URL pointer within XML tag
Hi.

I'm trying to extract text between two quotation marks in XML. For example, I want to ex

Wierd if else problem
Hi guys,

this probably aint wierd for you, but it seems like php is playin up to me. may b i

Getting PHP to ammended the selected in option field
Hey Guys

thanks for everyones help so far. This site and its users are oozing awesomness.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash