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

关于json_decode对象?解决思路

WBOY
WBOYOriginal
2016-06-13 12:33:05761browse

关于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无法保存类型的原因吗?

Statement:
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