php - JSON_PRETTY_PRINT and JSON_UNESCAPED_SLASHES in same argument -
i trying pretty print json array, , un-escape slashes @ same time, don't know how...
i've got:
<pre><?php echo json_encode($data, json_pretty_print); ?></pre>
or
<pre><?php echo json_encode($data, json_unescaped_slashes); ?></pre>
working fine on own, can't seem combine them.
found out how:
<pre><?php echo json_encode($data, json_unescaped_slashes | json_pretty_print); ?></pre>
read php bitwise operators.
Comments
Post a Comment