When to use the PHP function json_encode second parameter (bitmasks)

PHP json_encode performs the function of the second optional parameter (bitmask). Can someone explain to me why they are needed, and when should I use them and why?

thank

+5
source share
1 answer

The goal is to get rid of the special character in the JSON output. In certain situations, special characters may have different meanings, and you just want to pass JSON without using any of them.

Suppose you want to send json inside some XML. You do not want <in there messing with xml. Thus, you simply use the opportunity to get rid of them so as not to create any problems.

+1

All Articles