decode() public static method

decode string to json object
public static decode ( string $str, $options ) : mixed
$str string
return mixed object
Example #1
0
 function pageEntry($inPath)
 {
     $sm = new SJson();
     $testObject = new stdclass();
     $testObject->name = "SlightPHP";
     $testObject->value = array("min" => 1, "max" => 999);
     /**
      * 编码
      */
     print_r($tmp = $sm->encode($testObject));
     echo "\n";
     /**
      * 解码
      */
     print_r($sm->decode($tmp));
 }