Help: fwrite problem
Posted: Mon Jan 25, 2010 9:26 pm
I'm trying a little project where I'm trying to parse data from website and then writing to a text file. I'm successful in the pregmatch part and also succeeded to write on text using var_export. But the output of text file doesn't seem good.
The code i wrote is as follows:
It writes within MyOutput.txt as follows:
But I want to write in more organized way. Like I want sample output in MyOutput.txt:
Is it possible?
The code i wrote is as follows:
Code: Select all
$File = "MyOutput.txt";
$Handle = fopen($File, "a");
$customer = "DevNetwork";
fwrite($Handle, var_export($Data,1)) & fwrite($Handle, var_export($customer,1));
// $Data is used in Preg_match_all
Code: Select all
array ( 0 => array ( 0 => '', ), 1 => array ( 0 => '43, North Tower, NY', ), )'DevNetwork'Code: Select all
DevNetwork 43, North Tower, NY