예제 #1
0
 private function getInformation()
 {
     $data = new JSON($this->url);
     $update = array();
     foreach ($data->toArray() as $i) {
         $version = intval(str_replace(".", "", $i["Version"]));
         if ($version > $this->version) {
             $this->version = $version;
             $update = $i;
         }
     }
     return count($update) > 0 ? $update : null;
 }
예제 #2
0
 /**
  * Decodes a JSON string
  * @param string $str The json string being decoded.
  * @param boolean $isArray When TRUE, returned objects will be converted into associative arrays.
  * @return array
  */
 function json_decode($str, $isArray = true)
 {
     $json = new JSON();
     $arr = $json->decode($str);
     return $isArray ? $json->toArray($arr) : $arr;
 }