/** * Pass in an array to make into a JSON object * which will use the auto feature to for each * value when encoding * @param array $array * @return JSON */ public static function &arrayToJSON($array) { $json = new JSON(); foreach ($array as $property => $value) { $json->add($property, $value); } return $json; }