Home > Backend Development > PHP Tutorial > 怎么把js用的json数据,用php来还原

怎么把js用的json数据,用php来还原

WBOY
Release: 2016-06-13 12:44:47
Original
781 people have browsed it

如何把js用的json数据,用php来还原。
$str=file_get_contents("http://news.soso.com/frontpage.q?ty=1&city=%E6%B2%B3%E6%BA%90");
$str=stripslashes($str);
echo json_decode($str);   //这里老是不能输出数据。









Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template