03-19-2009, 02:30 AM
|
#3 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Krik
Soemthing like this may help
PHP Code:
<?php
function WritetoFile($file, $content) {
$fp = fopen($file, 'w');
fwrite($fp, $content);
fclose($fp);
}
$newcontent = 'The new content for myfile.txt';
WritetoFile('myfile.txt', $newcontent);
?>
|
Thanks Krik, I will give that a shot....
My program is about 1000 lines long. Towards the end is where I use the shell_exec...
It is all procedural, no OOP at all....
So can I create the function on the top of the program and use the WritetoFile() function anywhere in the script?
|
|
|
|