2017-02-23 15:21:34 +08:00
|
|
|
<?php
|
2016-08-30 16:00:29 +04:00
|
|
|
|
|
|
|
function load_obj_from_jsonfile($filename)
|
|
|
|
{
|
|
|
|
$file=file_get_contents($filename);
|
|
|
|
|
|
|
|
if($file)
|
|
|
|
{
|
|
|
|
$result=json_decode($file,true);
|
|
|
|
|
|
|
|
if($result)
|
|
|
|
{
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
print_r(json_last_error_msg());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
print_r("file_get_contents error");
|
|
|
|
}
|
|
|
|
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
|