December 13th, 2012, 10:55 AM
Processing the php page then output a .html file
I got this data entry into an html template job. I basically update their product pages with new text an images.
So instead of going through the html code and I wrote some php that would just change all the image links etc.
Their site doesn't support php. So I wanted php to generate the html which i got.
I could view source and copy that html and paste it in an html. But i was hoping to be even more lazy and find out how can I make php write a document of the document after it has been processed.
Does this make sense? So I can upload that .html onto the server.
Thanks so much!
December 13th, 2012, 11:16 AM
you can use PHP's output buffer to collect the HTML markup and write it to a file:
<?php ob_start(); // start the output buffering ?>
<?php file_put_contents( 'C:/htdocs/phpout.txt', ob_get_contents() ); // fetch the buffer content and write it to a file
December 13th, 2012, 11:31 AM
That totally worked. You are a god!!! Thank you so much.
December 14th, 2012, 02:19 PM
I have a follow up question with this process I want php to also change all trademark R (r) to <sup>(r)</sup
Originally Posted by Jacques1