I want to insert {"0":"1"}
into a mysql database which I thought was straightforward!
I did this:
$arr = array('0' => '1');
echo json_encode($arr);
But that gives ["1"]
however if I do this:
$arr = array('0' => '1',"b" =>"2");
echo json_encode($arr);
I get this
{"0":"1","b":"2"}
Can someone help and explain what I need to do to get:
{"0":"1"}
thanks