截獲網(wǎng)站title標(biāo)簽之家內(nèi)容的例子
更新時(shí)間:2006年10月09日 00:00:00 作者:
截獲網(wǎng)站title標(biāo)簽之家內(nèi)容的例子
參考:http://www.netasp.com.cn/valley/gettitle/index.php
代碼如下:
<pre>
<?
//get_title.php
$file=file("http://www.netasp.com.cn");
$count=count($file);
for($i=0;$i<$count;$i++){
if(eregi("<title>(.*)</title>",$file[$i],$out)){
$title=$out[0];
}
}
$title=substr($title,7,-8);
echo $title;
?>
</pre>
【本文版權(quán)歸作者與奧索網(wǎng)共同擁有,如需轉(zhuǎn)載,請(qǐng)注明作者及出處】
代碼如下:
<pre>
<?
//get_title.php
$file=file("http://www.netasp.com.cn");
$count=count($file);
for($i=0;$i<$count;$i++){
if(eregi("<title>(.*)</title>",$file[$i],$out)){
$title=$out[0];
}
}
$title=substr($title,7,-8);
echo $title;
?>
</pre>
【本文版權(quán)歸作者與奧索網(wǎng)共同擁有,如需轉(zhuǎn)載,請(qǐng)注明作者及出處】
相關(guān)文章
PHP入門學(xué)習(xí)的幾個(gè)不錯(cuò)的實(shí)例代碼
php連接數(shù)據(jù)庫(kù) php讀取數(shù)據(jù)庫(kù)中,某一字段值 php判斷表單是否提交等實(shí)例代碼2008-07-07
最小化數(shù)據(jù)傳輸——在客戶端存儲(chǔ)數(shù)據(jù)
最小化數(shù)據(jù)傳輸——在客戶端存儲(chǔ)數(shù)據(jù)...2006-10-10
親密接觸PHP之PHP語(yǔ)法學(xué)習(xí)筆記1
親密接觸PHP之PHP語(yǔ)法學(xué)習(xí)筆記1...2006-12-12

