On Mon, 25 Jan 2010 18:31:54 -0800, deal...@gmail.com ("deal...@gmail.com") 
wrote:

>
>On Jan 25, 2010, at 6:23 PM, Shawn McKenzie wrote:
>
>> file_put_contents() is soooo much easier.
>
>Thanks Shawn I'll check that out ...
>
>- I see it says : This function is identical to calling fopen(),  
>fwrite() and fclose() successively to write data to a file.
>
>
>my newbie brain likes that!
>
>
>Thanks,
>deal...@gmail.com
>[db-10]

In principle this is extremely simple. Take your existing procedure to generate 
the page
then:

1. $page = '';

2. Replace every echo 'whatever'; statement with $page .= 'whatever';, and 
every <html>
with $page .= '<html>';

3. file_put_contents($page,$file) // The manual is down (again!) and I have 
forgotten the
format.

4. echo( file_get_contents($file));  // to generate the PHP page.

However I strongly suspect that it is possible to simply redirect all the 
'echo's in your
existing procedure to write to $page (or $file?), without changing the code at 
all. Is
this so?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to