php - how can json_encode() not auto convert string to int -
so have array,
array ( [0] => array ( [task] => sleeping [duration] => 2 ) [1] => array ( [task] => eating [duration] => 1 ) )
when json_encode() it, returns
[{"task":"sleeping","duration":2},{"task":"eating","duration":1}]
i need be
[{"task":"sleeping","duration":"2"},{"task":"eating","duration":"1"}]
is there way how?
the dump shows variable inside array int in first place cast string before pushing inside array
Comments
Post a Comment