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

Firewall / visited websites logger
Hi. I have a firewall implementation and I want to log all the websites visited on the machine. S

CHECK A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

Get dump of MySQL DB from Live Site
I'm after an easy, but secure way of generating and importing a MySQL dump from a remote server.

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

Create or replace package is ending ORA-21700
Database 9.2.0., patch 8 (9.2.0.8.0).
I trying run
create or replace package ....etc.

Update not working ... please help
Hi,

I am trying to update a row using an edit form by passing id of the row .. but it is not

ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
database : XE

there is a table (transito) with two fields of clob

Running External Scripts
I am very new to PHP and am not even sure what I'm asking is possible. I have just installed mediaW

try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

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