dolibarr 19.0.3
|
Functions to emulate json function when there were not activated. More...
Go to the source code of this file.
Functions | |
if(!function_exists( 'json_encode')) | dol_json_encode ($elements) |
Implement json_encode for PHP that does not support it. | |
_val ($val) | |
Return text according to type. | |
if(!function_exists( 'json_decode')) | dol_json_decode ($json, $assoc=false) |
Implement json_decode for PHP that does not support it Use json_encode and json_decode in your code ! | |
_unval ($val) | |
Return text according to type. | |
utf162utf8 ($utf16) | |
Convert a string from one UTF-16 char to one UTF-8 char. | |
utf82utf16 ($utf8) | |
Convert a string from one UTF-8 char to one UTF-16 char. | |
Functions to emulate json function when there were not activated.
Definition in file json.lib.php.
_unval | ( | $val | ) |
Return text according to type.
string | $val | Value to decode |
Definition at line 313 of file json.lib.php.
References utf162utf8().
Referenced by dol_json_decode().
_val | ( | $val | ) |
Return text according to type.
mixed | $val | Value to show |
Implement json_decode for PHP that does not support it
string | $json | Json encoded to PHP Object or Array |
bool | $assoc | False return an object, true return an array |
Definition at line 120 of file json.lib.php.
References utf82utf16().
Referenced by dol_json_encode().
if(!function_exists('json_decode')) dol_json_decode | ( | $json, | |
$assoc = false ) |
Implement json_decode for PHP that does not support it Use json_encode and json_decode in your code !
string | $json | Json encoded to PHP Object or Array |
bool | $assoc | False return an object, true return an array. Try to always use it with true ! |
Definition at line 245 of file json.lib.php.
References _unval(), and dol_syslog().
if(!function_exists('json_encode')) dol_json_encode | ( | $elements | ) |
Implement json_encode for PHP that does not support it.
Use json_encode and json_decode in your code ! Note: We can found some special chars into a json string: Quotation mark (") = \", Backslash () = \, Slash (/) = \/, Backspace = , Form feed = \f, New line =
, Carriage return =\r, Horizontal tab = \t
mixed | $elements | PHP Object to json encode |
Definition at line 50 of file json.lib.php.
References _val(), and dol_syslog().
utf162utf8 | ( | $utf16 | ) |
Convert a string from one UTF-16 char to one UTF-8 char.
Normally should be handled by mb_convert_encoding, but provides a slower PHP-only method for installations that lack the multibye string extension.
string | $utf16 | UTF-16 character |
Definition at line 335 of file json.lib.php.
Referenced by _unval().
utf82utf16 | ( | $utf8 | ) |
Convert a string from one UTF-8 char to one UTF-16 char.
Normally should be handled by mb_convert_encoding, but provides a slower PHP-only method for installations that lack the multibye string extension.
string | $utf8 | UTF-8 character |
Definition at line 378 of file json.lib.php.
Referenced by _val().