Why doesn't strip_tags work in PHP?

jettfactor

New Member
I've got the following code:\[code\]<?php echo strip_tags($firstArticle->introtext); ?>\[/code\]Where $firstArticle is a stdClass object:\[code\]object(stdClass)[422] public 'link' => string '/maps101/index.php?option=com_content&view=article&id=57:greenlands-newest-iceberg&catid=11:geography-in-the-news' (length=125) public 'text' => string 'GREENLAND'S NEWEST ICEBERG' (length=26) public 'introtext' => string '<p>A giant chunk of ice calved off the Petermann Glacier on the northwest side of Greenland this summer. At nearly 100 square miles (260 sq. km) in size, four times the size of Manhattan, th' (length=206) public 'date' => object(JDate)[423] public '_date' => int 1284130800 public '_offset' => int 0 public '_errors' => array empty\[/code\]You can see that $firstArticle->introtext refers to the string:"\[code\]<p>\[/code\]A giant chunk of ice calved off the Petermann Glacier on the northwest side of Greenland this summer. At nearly 100 square miles (260 sq. km) in size, four times the size of Manhattan, th"The \[code\]<p>\[/code\] tag is a problem for me in this application, however strip_tags absolutely refuses to remove it and I can't figure out why. I actually gave up on strip_tags and attempted to do a preg_replace instead with the regex /<(.|\n)*?>/ :\[code\]preg_replace('/<(.|\n)*?>/', '', $firstArticle->introtext);\[/code\]But that didn't work either! How can I strip all HTML tags (matched or not) from this string when I output it?
 
Back
Top