What if the output is a png file? I'm using JPGraph to make pie charts. The following code doesn't work:
$handle = fopen("output.png", "w");
fwrite($handle, $graph->Stroke()); //(stroke draws the graph)
fclose($handle);
But if I use ">" it works.
I am just starting to learn PHP and I can't seem to find this anywhere. Basically I am running a script from the command line and I would like to capture the output and put it in a file but I would like to do so inside the script.
So instead of typing "myscript.php > myoutput.out" I could just...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.