? Mr.Snowman ?
New member
is there a way to make this work:
<?php
$fh = fopen("test.html", 'w') or die("can't open file");
$stringData = echo'hello';
fwrite($fh, $stringData);
fclose($fh);
?>
Basically I want to write the output (in this case 'hello') of a php function in to a file. So basicaly it would echo the hello and then write it to the file instead of writing "echo 'hello';" to the file, although the actual php I want to execute before writing to a file is much bigger (about 50 lines). I'm doing this because I want to make the mySQL queries execute and then update the website index.html file instead of just putting the queries into the index.
<?php
$fh = fopen("test.html", 'w') or die("can't open file");
$stringData = echo'hello';
fwrite($fh, $stringData);
fclose($fh);
?>
Basically I want to write the output (in this case 'hello') of a php function in to a file. So basicaly it would echo the hello and then write it to the file instead of writing "echo 'hello';" to the file, although the actual php I want to execute before writing to a file is much bigger (about 50 lines). I'm doing this because I want to make the mySQL queries execute and then update the website index.html file instead of just putting the queries into the index.