rgb192
asked on
from echo to file_put_contents
echo( implode(" ",$field )
. $CSV_separator);
echo to screen
I want to print to file.txt
file_put_contents("file.tx t","----an swer goes here---------------",FILE_ APPEND);
. $CSV_separator);
echo to screen
I want to print to file.txt
file_put_contents("file.tx
Use the output control.
http://us.php.net/manual/en/ref.outcontrol.php
ob_start();
echo [whatever]
$string = ob_get_contents();
ob_end_clean();
file_put_contents(("file.t xt", $string, FILE_APPEND);
http://us.php.net/manual/en/ref.outcontrol.php
ob_start();
echo [whatever]
$string = ob_get_contents();
ob_end_clean();
file_put_contents(("file.t
ASKER
I have many echo statements
would this work
ob_start();
echo [whatever]
..
code
..
echo [whatever]
echo [whatever]
..
code
..
echo [whatever]
$string = ob_get_contents();
ob_end_clean();
file_put_contents(("file.t xt", $string, FILE_APPEND);
would this work
ob_start();
echo [whatever]
..
code
..
echo [whatever]
echo [whatever]
..
code
..
echo [whatever]
$string = ob_get_contents();
ob_end_clean();
file_put_contents(("file.t
ASKER
I have many echo statements and for loops
would this work
ob_start();
echo [whatever]
..
code
..
for loop begin
echo [whatever]
for loop end
echo [whatever]
..
code
..
echo [whatever]
$string = ob_get_contents();
ob_end_clean();
file_put_contents(("file.t xt", $string, FILE_APPEND);
would this work
ob_start();
echo [whatever]
..
code
..
for loop begin
echo [whatever]
for loop end
echo [whatever]
..
code
..
echo [whatever]
$string = ob_get_contents();
ob_end_clean();
file_put_contents(("file.t
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
I think you can do it as following..
file_put_contents("file.tx
Thanks.