関数 Get_news($url,$count) { $handle = fopen($url,"r"); $c = 0; while(($line = fgets($handle,1024)) && ($c<$count)) { //$ptr2= "/(.*)/"; $ptr= "/(.*)/"; preg_match_all($ptr,$line,$str,PREG_SET_ORDER); if($str) { $res[$c]= ストリップ_タグ($str[0][2]); //$res[$c][1] = $url."admin/view_n.php?id=".$str[0][1]; $c = $c+1; } print_r($res[$c]); } $res を返す; } $url = "http://stu.gdmc.edu.cn/"; $count = 7; //エコー""; $result=Get_news($url,$count); foreach ($result as $key => $value) { echo iconv("gb2312", "UTF-8", $value)."";// } //print_r(Get_news($url,$count)); //エコー""; ?> http://www.bkjia.com/PHPjc/477644.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477644.html技術記事 ?php function Get_news($url,$count) { $handle = fopen($url,r); $c = 0; while(($line = fgets($handle,1024)) ($c$count)) { //$ptr2= /a href=\/html/xionaxinwen(.*)(.*)/a/; $ptr= /...