希望大家多多支持我在看云发布的手册,第一章对登录讲解的超级详细。http://www.kancloud.cn/w113211/killall《基于ThinkPHP5.0的各项后台小功能代码实现》
[/img]ThinkPhP两个版本的权限管理(3.2.3和5.0)
https://www.kancloud.cn/w113211/alls

<?php
function getwebcontent($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$contents = trim(curl_exec($ch));
curl_close($ch);
return $contents;
}
function DeleteHtml($str) {
$str = trim($str);
$str = str_replace("\t","",$str);
$str = str_replace("\r\n","",$str);
$str = str_replace("\r","",$str);
$str = str_replace("\n","",$str);
return trim($str);
}
set_time_limit(0);
$datas =DeleteHtml(getwebcontent('http://www.jin10.com'));
preg_match_all('/(\d{2}:\d{2})/',$datas,$time); /*对应的所有时间*/
preg_match_all('/<td[^>]+?id\s*?=\s*?"content_\d+?">(.+?)<\/td>/',$datas,$content); /*对应的所有内容*/
preg_match_all('/"普通新闻"|"重要新闻"|"一般数据"|"重要数据"/',$datas,$importance); /*对应的所有新闻的重要性*/
$contents=$content[1]; /*对应的所有内容*/
$times=$time[1]; /*对应的所有时间*/
$importances=$importance[0];
$news=[];
foreach ($contents as $key => $value) {
$t=[
"content"=>$value,
"time"=>$times[$key],
"importance"=>str_replace('"','',$importances[$key]),
];
array_push($news,$t);
}
var_dump($news);
?>
109news.rar
( 1.12 MB 下载:54 次 )
