note 118144 added to function.json-decode
| From: | descartavel1+php at gmail dot com | Date: | Tue, 13 Oct 2015 19:15:31 +0000 |
| Subject: | note 118144 added to function.json-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203951@lists.php.net to get a copy of this message | ||
<?php
/* wrapper to php's json_encode to work around the fact that some options we use are
* not available on php5.2, which we still support
* call to json_encode is silenced as we don't care about encoding warnings
*/
public static function php_json_encode_as_object($input){
if( (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)
|| PHP_MAJOR_VERSION < 5
){
// no support for JSON_FORCE_OBJECT
return @json_encode((object)$input);
}else{
return @json_encode($input, JSON_FORCE_OBJECT);
}
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 216.145.54.50
----
Manual Page -- http://php.net/manual/en/function.json-decode.php
Edit -- https://master.php.net/note/edit/118144
Del: integrated -- https://master.php.net/note/delete/118144/integrated
Del: useless -- https://master.php.net/note/delete/118144/useless
Del: bad code -- https://master.php.net/note/delete/118144/bad+code
Del: spam -- https://master.php.net/note/delete/118144/spam
Del: non-english -- https://master.php.net/note/delete/118144/non-english
Del: in docs -- https://master.php.net/note/delete/118144/in+docs
Del: other reasons-- https://master.php.net/note/delete/118144
Reject -- https://master.php.net/note/reject/118144
Search -- https://master.php.net/manage/user-notes.php