views:

63

answers:

2

Hi

PHP's json_encode function as a second optional param ( bitmasks ). Can someone explain to me what they're for and when I should use them and why?

Thanks

A: 

@Dominic: My question is why would you want to convert, the doc only shows the how not the why?

Jason
+1  A: 

The purpose is to get rid of special character in the JSON output. In certain situation the special characters may have other meanings and you just want to pass the JSON through without making use of any of those.

Suppose you want to send the json inside some XML. You don't want any < in there messing with the xml. So you just use the option to get rid of those so it doesn't cause any problems.

Winston Ewert