删除cURL中的html标签
问题描述:
我试图以纯文本的形式获取url的内容。目前我设法从网址获取所有HTML内容。我想知道是否可以删除cURL中的html标签。删除cURL中的html标签
<?php
// put your code here
$ch = curl_init();
$url = "http://visitbirmingham.com/explore-birmingham/blog";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$cResult = curl_exec($ch);
curl_close($ch);
$cResult = str_replace("<", "<", $cResult);
$cResult = str_replace(">", ">", $cResult);
echo $cResult;
?>
哇,谷歌_php删除html tags_是惊人的。 – AbraCadaver