cebuy Posted June 9, 2007 Share Posted June 9, 2007 How to Read all HTML Code before <body> and after </body> Tags? I am doing an include... include("filename.html"); What I want to do is include all html code in filename.html between <body> and </body>.. so if my include page was <html> <head> <title>My Page</title> </head> <body> <font color="red">Hello world!</a> <img src="mypicture.jpg"> etc etc... </body> </html> that it would include from filename.html to the page with the include only this part.. <font color="red">Hello world!</a> <img src="mypicture.jpg"> etc etc... instead of the entire thing like... <html> <head> <title>My Page</title> </head> <body> <font color="red">Hello world!</a> <img src="mypicture.jpg"> etc etc... </body> </html> What is best way to do this? Link to comment https://forums.phpfreaks.com/topic/54896-how-to-read-all-html-code-after-and-before-tag/ Share on other sites More sharing options...
cooldude832 Posted June 9, 2007 Share Posted June 9, 2007 say: $var = fopen("file","r"); $temp = explode ("\<body\>",$var); $temp = explode("\<body\\>",$temp[1]); $body = $temp[0]; Link to comment https://forums.phpfreaks.com/topic/54896-how-to-read-all-html-code-after-and-before-tag/#findComment-271508 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.