I have an array in PHP and want to use that data inside my Jquery, I have converted that to json and here is my full code.
$mine = array(
'new' => 'new',
'old' => 'old'
);
and I have converted it like this
$result = json_encode(array_values($cat));
and now I got my results like show below:
[{"new":"new","old":"old"}]
this is wrong one, because I want it to be like this way.
[
{"new":"new"},
{"old":"old"}
]
I don't know where am I doing any thing wrong but I am unable to get this simple thing done ... any one to help me out of this simple question please ... I really have been through many earlier questions like json_encode sparse PHP array as JSON array, not JSON object
But still unable to get this work for me, any one there to help me out pelase ???