The array printed with Print_r is this:
Array( [total] => 8 [rows] => Array ( [0] => Array ( [id] => 1 [email] => 379395979@qq.com [activated] => 1 [username] => yuan [created_at] => 2014-03-04 02:30:43
Why use Json_encode output after the other data are good, only activated this field will turn 1 into a true,0 to false, has anyone encountered this situation? How to resolve to output the original value ...
Frame is Laravel4
JSON values like this:
{"total":8,"rows":[{"id":1,"email":"379395979@qq.com","activated":true,"activated_at":null,"last_login":"2014-04-03 05:41:30","username":"yuan","created_at":"2014-03-04 02:30:43"}
Reply content:
The array printed with Print_r is this:
Array( [total] => 8 [rows] => Array ( [0] => Array ( [id] => 1 [email] => 379395979@qq.com [activated] => 1 [username] => yuan [created_at] => 2014-03-04 02:30:43
Why use Json_encode output after the other data are good, only activated this field will turn 1 into a true,0 to false, has anyone encountered this situation? How to resolve to output the original value ...
Frame is Laravel4
JSON values like this:
{"total":8,"rows":[{"id":1,"email":"379395979@qq.com","activated":true,"activated_at":null,"last_login":"2014-04-03 05:41:30","username":"yuan","created_at":"2014-03-04 02:30:43"}
Using var_dump to see the type of data source, LZ printing results are different, the problem is in the data source, if the data table is not a problem, it should be from the database to obtain data from the data format is problematic.
json_encode
No change bool
in value
..
I just got the wrong idea.
Tested a bit, did not find json_encode
a change ...
Laravel Source also did not find the conversion of the place.