[snip] I wish to use fwrite() to create a small PHP file. So far, when I attempt to do this, php parses the contents of the file that fwrite needs to create. Eg, I have this: [/snip]
Vince I did this <?php /* ** Write PHP with PHP ** 2003-09-05 */ $newphp = fopen("/usr/server/test/new_php.php", "w"); fputs($newphp, "<?php\n"); fputs($newphp, "This is a PHP by PHP writing test.\n"); fputs($newphp, "?>\n"); fclose($newphp); ?> And it worked fine. fputs() places the string in the file properly. I also noticed at the end of your script.... write($new_file, $new_file_content); Since I saw no write() function in your script I would have to assume that you are calling an undefined function, which is probably where your errors are coming from. Try changing the line to fputs($new_file, $new_file_content); And you should have much luck. Have a pleasant, productive and meaningful day. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php