11-28-2008, 10:50 PM
|
#2 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Here it is nice and simple. You don't necessarily need to use the fopen, fwrite and fclose functions as PHP5 packages those nicely into one function for us:
php Code:
$szData = 'TalkPHP.com'; $szFolder = sprintf('./%s/', 'Wildhoney'); $szFile = sprintf('%s.txt', date('Y-m-d')); if (! is_dir($szFolder)){ mkdir($szFolder); }file_put_contents ($szFolder . $szFile, $szData);
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|