I have an array similar to :
[0] => stdClass Object
(
[name] => John
[id] => 1
[pass] => 0
)
The array is returned by a sql query. Now I need to use json_encode
and I want the id to be integer and pass Boolean, but they get string types after json_encode
. How can I do it with the correct datatypes in json_encode
?