Question on strip_tags

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!

Moderator: General Moderators

Post Reply
epodismo
Forum Newbie
Posts: 2
Joined: Sun Jun 28, 2009 5:27 pm

Question on strip_tags

Post by epodismo »

I would like to use the <INCLUDE> function to include an HTML page into a php one.

The problem is that the HTML tags in the HTML Page (font, font color and font size, in particular) are breaking the template of my php page.

Is there a way to use the strip_tags function to clean, not a string, but the content of a specific page? In other words, I would like to use something like

strip_tags(http://www.test.com/page.html);

rather than

strip_tags($text);

If this is not possible, can someone point me to a solution that will allow me to change the font, font color and font size when importing HTML content with INCLUDE? Thanks.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Question on strip_tags

Post by requinix »

Use file_get_contents to read the file into a string, use strip_tags on it, then echo or print it wherever you want.
epodismo
Forum Newbie
Posts: 2
Joined: Sun Jun 28, 2009 5:27 pm

Re: Question on strip_tags

Post by epodismo »

Thank you much! Works!
Post Reply