I need to display an array sent by a form from a previous page that contains property ids. Normally this would be easy with a foreach but I use a text file as a database. At present I display the database like this
$array = file('../xfile.txt');
$anything=array_shift($array);
foreach($array as $row) {
$line = explode('","', $row);
which works fine. On another page I wish to pass it an array of property ids so it only displays a few properties. So far I can only get this to work with one property using:
$array = file('../xfile.txt');
$anything=array_shift($array);
foreach($array as $row) {
$line = explode('","', $row);
if (eregi($id, $line[1])){
$id is the array I'm trying pass and $line[1] is the list of property id's the eregi function is searching against. The above works fine with only one property. How do I make it work with more than one? I'm guessing I need another foreach in there somewhere?
Please help?