我引用以下法典:
<?php echo strip_tags($firstArticle->introtext); ?>
如果第一元为混凝土,
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
您可以看到,第1条及第1条及第1条及第2款所指的是:
“<p>
A giant chunk of ice calved off the Petermann Glacier, on the North 西边,格陵兰岛西北部。 面积近100平方英里(260平方公里),四倍于曼哈顿,th”。
The <p>
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 /<(.|
)*?>/ :
preg_replace( /<(.|
)*?>/ , , $firstArticle->introtext);
但是,这不行不通! 在我产出时,我怎么能够把所有超文本标签(附后)从该指示中删除?