Getting file from local filesystem after being parsed by PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
triggerhippy
Forum Newbie
Posts: 1
Joined: Fri Mar 02, 2007 6:03 am

Getting file from local filesystem after being parsed by PHP

Post by triggerhippy »

I am writing a script to 'flatten' (create a static version of) dynamic pages.
I want to get a php file from the local filesystem BUT I want PHP to parse and execute the file before returning it.
Similar to file_get_contents() but instead of returnin ghte php source code, I want it to process it and return the resulting page.

Any ideas?

I am currently using cURL which works, but uses up masses of bandwidth as it gets the file by absolute URL going out and back in through the firewall (I think).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

ob_start() is useful here.
Post Reply