data = $data; } else { $data = $this->data; } if (is_string($data)) return $data; // Lets use JSON as an output format if the value isn't scalar return '
' . json_encode($data, JSON_PRETTY_PRINT) . ''; } /** * Convert the encoded data to a native format * * @param string $data_string * @return object */ public function unserialize($data_string) { return NULL; } } // -------------------------------------------------------------------------- // ! Helper function // -------------------------------------------------------------------------- /** * Function to simplify type instantiation * * @param mixed $data * @return JSON */ function HTML($data = NULL) { return new JSON($data); } // End of types/JSON.php