Let's say I have
$flags=JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
How can I then remove JSON_UNESCAPED_SLASHES from $flags?
It's not "C method" it's just applying bitwise operators
$flags=JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
var_dump($flags & JSON_UNESCAPED_SLASHES); // flag should be set to 1
$flags &= ~JSON_UNESCAPED_SLASHES; // remove it
var_dump($flags & JSON_UNESCAPED_SLASHES); // flag should be set to 0
using the C method
$flags &= ~JSON_UNESCAPED_SLASHES;
seems to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With