Search through text file
Posted: Tue Jan 30, 2007 11:21 am
I would like some code to search a text file.
Here is my text file:
Firewall*1
Scary Movie 4*2
Date Movie*3
What I want the code to do is lets say I search "Scary Movie". It will place Scary Movie 4 into the array (i'll explain why an array in a minute) named $title and the number after the asterisk into the array $id.
And if I search just "Movie" I would like to place both "Scary Movie 4" and "Date Movie" into the array $title and both "2" and "3" into the $id array.
I think I've explained this enough, if you need me to elaborate a bit more please say. Any help is appreciated.
Here is my text file:
Firewall*1
Scary Movie 4*2
Date Movie*3
What I want the code to do is lets say I search "Scary Movie". It will place Scary Movie 4 into the array (i'll explain why an array in a minute) named $title and the number after the asterisk into the array $id.
And if I search just "Movie" I would like to place both "Scary Movie 4" and "Date Movie" into the array $title and both "2" and "3" into the $id array.
I think I've explained this enough, if you need me to elaborate a bit more please say. Any help is appreciated.