调用知乎接口,获取当天新闻,抛弃图片保存本地的代码,仅保留内容获取部分。<?php echo zhihu60(); function zhihu60() { $date = file_g
<?php echo zhihu60(); function zhihu60() { $date = file_get_contents('https://www.zhihu.com/api/v4/columns/c_1261258401923026944/items'); $date = json_decode($date); $content = $date->data[0]->content; $content = preg_replace('/(<a.*?>[sS]*?<\/a>)/', '', $content); $content = strip_tags($content, '<p>'); return $content; }; ?>
粉丝
0
关注
0
收藏
0