I have a JSON string (external file) which has an element which can either have FALSE or TRUE as a value. In the file, the true or false IS there. However, after I use json_decode on it, the true or false is lost. Why?
The JSON is valid, it is made from many blocks of
{
"surroundedDebuff":true,
"citizenId":108981,
"citizenship":19,
"berserk":true,
"defenderSide":false,
"weapon":0,
"time":"25-03-2012 16:07:13:442",
"damage":65
}
(this repeated many times), the checking is a simple print_r.
print_r doesn’t show types, so it will display 0 for false and 1 for true. var_dump will show that the values are actually booleans.
Outputs: