Hi, i have written a php script which creates a lot of text (javascript) from values of a database.This values do not change often, so there is no need to generate them each time the page is loading.
Basically i need something, what would call the page (which generates the javascript code) and store it in a separate file. I guess the first step is to make a long array out of the source code of the parsed page. Anyone has an idia? please help... if i use fopen it will not parse the page
Thanx in advance
Store source code of a page
Moderator: General Moderators
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
Start an output buffer, [php_man]ob_start()[/php_man], include the file that creates the js, get the output using [php_man]ob_get_contents()[/php_man] save that output to a file ([php_man]file_put_contents()[/php_man]) and clean up with [php_man]ob_end_clean()[/php_man]. Call as needed. You could even cron it. Think that will work?