There is a function called ShowAmazon() that grabs some content from Amazon through their provided XML. There is no problem with this function and it works just fine.
You can see some test output of it at http://www.key2marketing.com/amazon/ama ... p?com=show . As you can see, it does its job.
Now I would like to put this output into a file instead of screen. I created this function:
Code: Select all
function file_put_body ($filename, $file_body) {
$tempname = tempnam($file_path, $filename);
$handle = fopen($tempname, 'wb');
fwrite($handle, $file_body);
fclose($handle);
unlink ($filename);
rename($tempname, $filename);
chmod ($filename, 0777);
return $file_body;
}Then let's put the output to a file...
Code: Select all
$file = 'replace.html';
file_put_body ($file, ShowAmazon());Any help is *very* welcome.
Thanks!
Tomas