note 127959 added to json.constants
| From: | ahu at 52q dot net | Date: | Fri, 25 Nov 2022 03:25:18 +0000 |
| Subject: | note 127959 added to json.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219914@lists.php.net to get a copy of this message | ||
If you want to set the both constants below at the same time:
· JSON_UNESCAPED_UNICODE
· JSON_UNESCAPED_SLASHES
Normally you can do like this:
json_encode($array, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
while you can do it in a simpler way:
json_encode($array, 320);
since the numeric values of the constants are:
JSON_UNESCAPED_SLASHES => 64
JSON_UNESCAPED_UNICODE => 256
so you know:
JSON_UNESCAPED_UNICODE + JSON_UNESCAPED_SLASHES = 320
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.161 (proxied: 185.14.47.112)
----
Manual Page -- https://php.net/manual/en/json.constants.php
Edit -- https://main.php.net/note/edit/127959
Del: integrated -- https://main.php.net/note/delete/127959/integrated
Del: useless -- https://main.php.net/note/delete/127959/useless
Del: bad code -- https://main.php.net/note/delete/127959/bad+code
Del: spam -- https://main.php.net/note/delete/127959/spam
Del: non-english -- https://main.php.net/note/delete/127959/non-english
Del: in docs -- https://main.php.net/note/delete/127959/in+docs
Del: other reasons-- https://main.php.net/note/delete/127959
Reject -- https://main.php.net/note/reject/127959
Search -- https://main.php.net/manage/user-notes.php