Write an array to a txt file
Posted: Tue Feb 05, 2008 11:40 am
Does anyone know how I can write an array to a text file? Basically I want to full post array to a text file. Thanks!
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$myFile = "post.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = var_export($_POST);
fwrite($fh, $stringData);
fclose($fh);
echo $stringData;