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!
I want to read contents of an html file between body tags.
for example : here are contents of html file. and i want to fetch contents between <body bgcolor="#CCCCCC"> and </body> tags. then after doing the modification to this i want to replace between content between body tags using files, i need help in updating file, means when i am updating my file how i can search body tagas and then replace contets between them?
In simple words i want to put my content between <body ....> and </body> tags.
itsmani1 wrote:I want to read contents of an html file between body tags.
for example : here are contents of html file. and i want to fetch contents between <body bgcolor="#CCCCCC"> and </body> tags. then after doing the modification to this i want to replace between content between body tags using files, i need help in updating file, means when i am updating my file how i can search body tagas and then replace contets between them?
In simple words i want to put my content between <body ....> and </body> tags.
should do the trick (assuming, $content has been declared / initialised).
Or do you mean modifying a html page by reading its content via a php-script and then replacing the file itself?
For this approach I'd recommend preg_match_all.