越简单越好!

去除带<>的HTML

发表于 2006-12-01 17:09 | 106次阅读 0次点赞   PHP


function delhtml($content){
    $content = eregi_replace("<html>.+</head>","", $content);
    $content = preg_replace("/<.+?>/i","", $content);
    return $content;
}

$oneurl = "http://www.chenapp.com";

$content = file_get_contents($oneurl);

echo delhtml($content);


返回顶部 ^