<? $save1 = "c:\news.xml"; $out = file_get_contents("http://www.xbox-scene.com/xbox1data/xbox-scene.xml","r"); if(fwrite($out, $save1, strlen($save1)) ===FALSE) { echo "Error"; exit; } echo "success"; fclose($out); ?>
it echos success, but it does not create the local file... even if i create an empty file for it, it doesn't parse into it
You need to read the manual page for fwrite. You have to [man]fopen[/man] the file for writing first, then the arguments for fwite goes handle first(from fopen), then the content. The length is not neccesary.
like this?
<? $save1 = "c:\news.xml"; $out = file_get_contents("http://www.xbox-scene.com/xbox1data/xbox-scene.xml","r"); $fp=fopen($save1, "w"); if(fwrite($out, $fp) ===FALSE) { echo "Error"; exit; } echo "success"; fclose($fp); ?>
It would be fwrite($fp, $out)
freaking awesome... thank you!