Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- if (is_array($param)) {
- $out .= '{'
- foreach ( $param as $key => $val) {
- assert(!is_string($key));
- $out .= "$key:" . this->encode_json($val);
- }
- $out .= '}'
- }
- // caso 3 BOOLEAN
- elseif (is_bool($param)) {
- if ($param)
- $out .= 'true';
- else
- $out .= 'false';
- }
- // caso 4 STRINGA
- elseif ( is_string($param)) {
- // sottocaso : inizia per 'function'
- if ( strstr( $in, "function" )) {
- $out .= "{$in}";
- }
- //sto passando una variabile
- elseif (!is_numeric($param)) {
- $out .= $param;
- }
- }
- // caso 5 NUMERICO
- elseif (is_numeric($param)) {
- $out .= intval($param);
- }
- //caso 6 NULL
- elseif (is_null($param)) {
- $out .= 'null';
- }
- return $out;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement