读取其它网站信息

function cut_html($html, $start, $end) {
	if (empty($html)) return false;
	$html = str_replace(array("\r", "\n"), "", $html);
	$start = str_replace(array("\r", "\n"), "", $start);
	$end = str_replace(array("\r", "\n"), "", $end);
	$html = explode(trim($start), $html);
 
	for ($i=1;$i<4;$i++){
		$array[$i] = $html[$i];
		$array[$i] = explode(trim($end), @$array[$i]);
	}
 
	return $array;
} 
$content = @file_get_contents('http://dg.woniu.com/news/notice/');
$value = cut_html($content,'<span class="ej_listL_left">','</span>');

读取其它网站信息,并显示三条数据

相关内容:

Leave a comment

2 Comments.

  1. php的?看不大懂。

发表评论

您的电子邮箱不会被公开。 标记为 * 的区域必须填写

*


您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

有人回复时邮件通知我