daveoffy Posted March 3, 2009 Share Posted March 3, 2009 I want to stop this error even if it is true. Or how can I make a file using PHP? Error = Warning: file_get_contents(sites/offy/Web Site/blah.php) [function.file-get-contents]: failed to open stream: No such file or directory in /address/to/file/ on line 39 Link to comment https://forums.phpfreaks.com/topic/147815-solved-stop-error-warning-file_get_contents/ Share on other sites More sharing options...
samshel Posted March 3, 2009 Share Posted March 3, 2009 if(file_exists('sites/offy/Web Site/blah.php')) { //open it } else { //create it $fd = fopen('sites/offy/Web Site/blah.php', "w"); fwrite($fd, $str);//write to it fclose($fd);//close it } Link to comment https://forums.phpfreaks.com/topic/147815-solved-stop-error-warning-file_get_contents/#findComment-775869 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.