Home > Backend Development > PHP Tutorial > 关于json_decode对象?解决思路

关于json_decode对象?解决思路

WBOY
Release: 2016-06-13 12:33:05
Original
775 people have browsed it

关于json_decode对象?
class Demp{
public $a=10;
function test()
{
echo "aaa";
}
}

$p=new Demp();
$c=json_encode($p);
//json_decode($c)->test();  
?>

打印json_decode($c)->a 可以 
无法调用test()是因为json无法保存类型的原因吗?

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