can u tell how i can dynamically save our web page like save as option....
Printable View
can u tell how i can dynamically save our web page like save as option....
Like a backup script?
You could use curl and save the text output.
I think perhaps what you are looking for is the fwrite() function.
First of course, you'd have to understand the fopen() and flock() functions. Heres an example pulled out of the book, PHP 6 A Beginner's Guide.
PHP Code:<?php
// open and lock file
// write string to file
// unlock and close file
$data = "A fish \n out of \n water\n";
$fp = fopen('output.txt', 'w') or die('ERROR: Cannot open file');
flock($fp, LOCK_EX) or die ('ERROR: Cannot lock file');
fwrite($fp, $data) or die ('ERROR: Cannot write file');
flock($fp, LOCK_UN) or die ('ERROR: Cannot unlock file');
fclose($fp);
echo 'Data written to file';
?>