现在的文件是这样的:
<p>User friendly buttons and IR Remote Control for easy control </p>
<p>Quality stereo headset enables user to enjoy hi-fi dynamic sound </p>
<p>Replaceable, rechargeable Li-polymer battery </p>
<p>Specs Video transmission frequency: 2414, 2432, 2450, 2468 </p>
<p>Transmission distance: Approx 100m in open space </p>
<p>Bitmap Audio carrier wave: 6.0Mhz, 6.5mHz, + 50Khz </p>
<p> </p>
<p>S/N Ratio: 50-70 db </p>
<p>Diplay: True Color Micro LCD </p>
<p>Resolution: Full color 922k pixels, 640*480 </p>
<p>Viewing Angle: Diagonal 32 degree </p>
<p>Virtual Image Size: 80inches at 2M away </p>
<p>Contrast: 64:1, Color Depth: 24 bit </p>
我想获得相同的文件,但只是文本(carrefull有像&amp; lt那样的东西,我希望它们是“&lt;”
答案 0 :(得分:5)
<?php
$str = html_entity_decode(strip_tags($str));
?>
答案 1 :(得分:4)
$html = '<p>Your < html > here</p>';
$text = strip_tags($html);
$text = html_entity_decode($text);
echo $text;
输出:Your < html > here
剥离代码doc:http://us.php.net/manual/en/function.strip-tags.php
Html Entity Decode doc:http://php.net/manual/en/function.html-entity-decode.php
答案 2 :(得分:0)
PHP函数strip_tags将删除所有<p>
,html_entity_decode将修复您的<
和co。