theniteowl
Programmer
Hi All,
I am looking to read in a .htm file and parse the contents so they can be inserted into a template page and sent to the browser.
Primarily I need to strip out the head and body tags so the remaining HTML can be added directly into the existing page.
The pages would be on the same server.
Can PHP read in a .htm or even .php file as text information directly? I want to keep the code all server side.
The purpose is to allow content creators to create their html page however they wish but have that page appear within a specified area of the templated page and I do not want them to have to worry about using a specific template of their own or having to remember to remove the html, head, body tags so we do not end up with them embeded within the body of another page.
If anyone has any code to read an html file into a string or code that will parse out the string to return all code between specific tags it would be a great start.
At my age I still learn something new every day, but I forget two others.
I am looking to read in a .htm file and parse the contents so they can be inserted into a template page and sent to the browser.
Primarily I need to strip out the head and body tags so the remaining HTML can be added directly into the existing page.
The pages would be on the same server.
Can PHP read in a .htm or even .php file as text information directly? I want to keep the code all server side.
The purpose is to allow content creators to create their html page however they wish but have that page appear within a specified area of the templated page and I do not want them to have to worry about using a specific template of their own or having to remember to remove the html, head, body tags so we do not end up with them embeded within the body of another page.
If anyone has any code to read an html file into a string or code that will parse out the string to return all code between specific tags it would be a great start.
At my age I still learn something new every day, but I forget two others.