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))
{
$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

how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt ?
how to put the 0-100 numbers into 1.txt and 100-200 into 2.txt and so on 200-300 into file 3.txt ?

Checkbox info wont include in Mailto
Hey, im new to php.
Basically I have made a form to request which type of job(s) are needed, whic

dynamic table with forms
I have a table that is populated with mysql data and in teh first column there is a raido button tha

Question about ShowWindow()
Hello....

I'm struggling with sumpin, and I hope y'all can help.

I've got a CFormView

Check Date/Time in PHP
What I need the code to check is that $reQuest is 24 hours in the past then return a time based on h

breaking a text file into paragraphs based on strings
I have a text file of email addresses that is all squished together. It looks like this:

abc

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

Find only certain URLs from page ... regex (semi-complete script)
Hi guys,

What I need to do is take a page & extract all the URLs from the page &a

Sequencing or queuing parallel process
Scenario is as follows
There is one parent process say P1 and 4 child processes say A B C D

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

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