fork(2) download
  1. <?php
  2. $text = "<html><head></head><body><h1>Hello</h1></body></html>" ;
  3. $fp = fopen("file.html", "w");
  4.  
  5. // записываем в файл текст
  6. fwrite($fp, $text);
  7.  
  8. // закрываем
  9. fclose($fp);
  10. ?>
Success #stdin #stdout #stderr 0.03s 52480KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  fopen(file.html): failed to open stream: Permission denied in /home/atlB82/prog.php on line 4
PHP Warning:  fwrite() expects parameter 1 to be resource, boolean given in /home/atlB82/prog.php on line 7
PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in /home/atlB82/prog.php on line 10