If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

json_encode() has built-in logic to detect Boolean values and convert them into the string representation used for JSON. In PHP, however, when you echo a Boolean, it does an implicit type cast to a string (since that's all you can really print/echo), for which true becomes "1" and false becomes "". You might want to make a little function to detect Booleans and output whatever you want in such a case.

It's probably fine for a single use like that. However, if you're going to end up doing the same thing in several places, I'd define a function something like one of those I wrote above so that you can follow the DRY principle (Don't Repeat Yourself).