Page 1 of 1

how to strip some html tags from a file before including it?

Posted: Wed Jan 03, 2007 11:56 am
by boom4x
Hello,
I know to include a file we use

Code: Select all

include('myfile.html');
Here is where im stuck: before file is displayed, it strips the following tags: <html> <head> <body> </body> </head> </html> out of the file.


I am using the FCK Editor (WYSIWYG) and it keeps adding those tags to my files which is annoying.

I thank anyone in advance that can help :D

Posted: Wed Jan 03, 2007 12:05 pm
by feyd
Regular expressions can remove them. Alternately, you could alter how the files are created removing them on that end. It will make execution faster in the end.

Re: how to strip some html tags from a file before including

Posted: Wed Jan 03, 2007 12:07 pm
by Kieran Huggins
boom4x wrote:Hello,
I know to include a file we use

Code: Select all

include('myfile.html');
Here is where im stuck: before file is displayed, it strips the following tags: <html> <head> <body> </body> </head> </html> out of the file.
Maybe readfile() is what you're looking for.
boom4x wrote:I am using the FCK Editor (WYSIWYG) and it keeps adding those tags to my files which is annoying.
There's a setting for that in FCKeditor

Posted: Wed Jan 03, 2007 2:01 pm
by Z3RO21
http://us3.php.net/striptags maby this could be of some use, just specify the tags you want to keep