| Author |
sending php output to a file
|
|
|
| what i want to do is as well as displaying a php generated page on the users
browser i want the same page to be put into a new html file .
or even just send the output directly to a file rather than the browser.
any pointers would be great.
| |
| Janwillem Borleffs 2004-11-29, 3:59 pm |
| chris wrote:
> what i want to do is as well as displaying a php generated page on
> the users browser i want the same page to be put into a new html file
> .
> or even just send the output directly to a file rather than the
> browser.
> any pointers would be great.
Have a look at the output control functions:
http://www.php.net/manual/en/ref.outcontrol.php
JW
| |
|
| thanks for that
but how do i tell it to output the info to a file rather than the browser?
"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:41a9959b$0$76506$b83b6cc0@news.euronet.nl...
> chris wrote:
>
> Have a look at the output control functions:
>
> http://www.php.net/manual/en/ref.outcontrol.php
>
>
> JW
>
>
>
| |
| Janwillem Borleffs 2004-11-29, 3:59 pm |
| chris wrote:
> thanks for that
> but how do i tell it to output the info to a file rather than the
> browser?
<?php
ob_start();
// Do your stuff
// Store the contents in a variable which
// you can store in a file
$contents = ob_get_contents();
// Display content
ob_end_flush();
?>
JW
|
|
|
|