Jump to content

Archived

This topic is now archived and is closed to further replies.

BrandonKahre

Read half a file, parse PHP and display results

Recommended Posts

I have a unique situation where I need to be able to request a file (a template of my site actually), read it from <body> to <!-- ### ---> (non-inclusive), prase the PHP in between there, and display the results. After I do that I'll need to do the opposite: <!--- ### ---> to </body>

My first attempt at this gives me the straight code not parsed as PHP (the page I will be displaying this on, Miva shopping cart software, will not render PHP). I tried to use fopen and fgets.

Is there a better solution to this? I would like to avoid having to manually split the two files in half and including them that way, but if I do it that way, it will work. The problem with that is if I make changes to the template for my other pages, I have to manually copy the changes over to the second template pages.

Any ideas?

Thanks

Brandon

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.