note 101843 deleted from function.json-encode by crell
| From: | crell@php.net | Date: | Thu, 30 Jun 2022 19:47:48 +0000 |
| Subject: | note 101843 deleted from function.json-encode by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218796@lists.php.net to get a copy of this message | ||
Note Submitter: dan at elearnapp dot com
----
If you need to force an object (ex: empty array) you can also do:
<?php json_encode( (object)$arr ); ?>
which acts the same as
<?php json_encode($arr, JSON_FORCE_OBJECT); ?>