<?php
error_reporting(0);
header('Content-Type: text/html; charset=UTF-8');
preg_match('/<script id=\"js-initialData\" type=\"text\/json\">(.*?)<\/script>/ism',file_get_contents("https://www.zhihu.com/people/mt36501"),$matchdata);
$data=json_decode($matchdata[1],true);
$json=end($data['initialState']['entities']['articles']);
$json=strip_tags($json[content],'<p>');
$json = preg_replace('/https?:\/\/\S*\d+[^<>\s]*/', '', $json);
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>每天60秒读懂世界 </title>
<style>
body{
margin: 0;
padding: 0;
}
.container{
margin: 5px;
padding: 5px;
border-radius: 5px;
box-sizing: border-box;
font-size: 0.8rem;
border: solid 2px green;
min-height: calc(100vh - 10px);
le
<?php
error_reporting(0);
header('Content-Type: text/html; charset=UTF-8');
preg_match('/<script id=\"js-initialData\" type=\"text\/json\">(.*?)<\/script>/ism',file_get_contents("https://www.zhihu.com/people/mt36501"),$matchdata);
$data=json_decode($matchdata[1],true);
$json=end($data['initialState']['entities']['articles']);
$json=strip_tags($json[content],'<p>');
echo <<<A
<html>
<body>
<title>每天60秒读懂世界</title>
<style type="text/css">
p:hover{
font-weight:bold;
}
body{
background-image:url(bg1.png);
}
div{
border-radius:30px;
border:2px solid green;
margin:2% 10%;
}
p{
font-size:30px;
text-align: left;padding:0% 4%;
}
</style>
A;
echo '<div>',$json,'</div></body></html>';
?>
六十秒读懂世界
http://987931.top/60snews.php
源码放后面楼里,排版不好,求大佬再帮我改一下吖。