I have this set of code.  and what I want to know how to do is how to 
filter one or more vars in the flat file?  For example filter all the 
people that work "at night"

I'm assuming it has to be in this part of the code:
for($i = 0; $i < count($arr_lines); $i++)
{
     $arr_data = explode($delim, $arr_lines[$i]);
     print $arr_data[0].' '.$arr_data[1].' '.$arr_data[2].'<BR>';
}

But where do I add an IF statement if that is what is needed?

<?php

/*assigned vars*/
$delim = "\t";
$file_path = "newfile.dat";

$name = "matt";
$works = "at night";
$programs = "php";

/*exporting data to flat file*/
$file = fopen($file_path, "a");
fwrite($file, $name.$delim);
fwrite($file, $works.$delim);
fwrite($file, $programs);
fwrite($file, "\n");
fclose($file);

$file = fopen($file_path,"r");
$page = fread($file, 4950);

$arr_lines = explode("\n", $page);
for($i = 0; $i < count($arr_lines); $i++)
{
     $arr_data = explode($delim, $arr_lines[$i]);
     print $arr_data[0].' '.$arr_data[1].' '.$arr_data[2].'<BR>';
}

fclose($file);

?>

TIA!

-Matt



-- 
Matt Zur
[EMAIL PROTECTED]
http://www.zurnet.com

Need a Web Site??? - Visit... www.zurnet.com

1997 - 2002 - 5th Anniversary!!!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to