How to use multiple flags for php function json_encode ()?
json_encode($array, JSON_PRETTY_PRINT, JSON_UNESCAPED_UNICODE);
This does not work - since only the first flag will be executed, the second will be ignored.
You are using a bitmask, as indicated in http://php.net/manual/en/function.json-encode.php :
json_encode($array, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
This will add binary values JSON_PRETTY_PRINTand JSON_UNESCAPED_UNICODEwith the binary OR operator.
JSON_PRETTY_PRINT
JSON_UNESCAPED_UNICODE
These flags are bitmasks . I wrote about this once a long time ago here on SO .
So basically, to use more than one option, you need to or them together
json_encode($array, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);