drifter Posted December 5, 2006 Share Posted December 5, 2006 I want to save the output of a page to a DB or file or something. Is there a way to return the complete output of a page up to a point - including all error messages - to a string. That I can then work with.ThanksScott Link to comment https://forums.phpfreaks.com/topic/29549-save-all-page-output-to-a-string/ Share on other sites More sharing options...
Orio Posted December 5, 2006 Share Posted December 5, 2006 Are you looking for something like [url=http://php.net/file-get-contents]file_get_contents()[/url]? (you can use a URL in it to get the output)Orio. Link to comment https://forums.phpfreaks.com/topic/29549-save-all-page-output-to-a-string/#findComment-135592 Share on other sites More sharing options...
craygo Posted December 5, 2006 Share Posted December 5, 2006 sure instead of echoing out your stuff, store it in a variableexample:instead of[code]echo "<td>some date here</td>";[/code]use[code]$html = "";$html .= "<td>some data here</td>\n";[/code]So everytime you want to store date in the $html you cal it as $html .=then if you want to same it you can just write it to a file or store it by calling $htmlRay Link to comment https://forums.phpfreaks.com/topic/29549-save-all-page-output-to-a-string/#findComment-135600 Share on other sites More sharing options...
drifter Posted December 5, 2006 Author Share Posted December 5, 2006 Well I found this - $output=ob_get_contents(); ob_flush();not sure if is saves error messages yet.Also - the file_get_contents gave me an idea - break my page into server and call them using file_get_contents to get the result back... may work too.as far as $html .= - I need the error messages as well if possibleThanks guys Link to comment https://forums.phpfreaks.com/topic/29549-save-all-page-output-to-a-string/#findComment-135639 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.