partial match on array_search?
| From: | Ian Truelsen | Date: | Mon, 20 Oct 2003 00:26:15 +0000 |
| Subject: | partial match on array_search? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-166700@lists.php.net to get a copy of this message | ||
I am trying to parse out a file using an array. I load each line into a
separate key in the array and then do transforms on the individual
lines.
What I am looking to do is to test each for a keyword so that I can know
which entry contains the data that I need and can get the data from the
correct line.
For example, I have the following line:
Wind: from the SW (230 degrees) at 3 MPH (3 KT):0
What I want to do is to identify the line by 'Wind'. However, using
array_search requires that I match the complete content of the line
exactly, which I can't do, as I don't know the exact data.
Is there any way to get array_search to find a partial match? Or is
there another command that I can use to do this?
--
Ian Truelsen
Email: ian@ihtruelsen.dyndns.org
AIM: ihtruelsen
Homepage: http://www.ihtruelsen.dyndns.org