|
dolibarr
13.0.2
|
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. More... | |
| _val ($val) | |
| Return text according to type. More... | |
| 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 ! More... | |
| _unval ($val) | |
| Return text according to type. More... | |
| utf162utf8 ($utf16) | |
| Convert a string from one UTF-16 char to one UTF-8 char. More... | |
| utf82utf16 ($utf8) | |
| Convert a string from one UTF-8 char to one UTF-16 char. More... | |
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 287 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 104 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 225 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 !
| mixed | $elements | PHP Object to json encode |
Definition at line 48 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 310 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 353 of file json.lib.php.
Referenced by _val().