I have a php array(zero indexed) which I am sending to front end directly by echoing its json_encode format.
I want the JSON object to look like
{
'A': null,
'B': null,
'C': null
}
But when I tried console.log i.e.,
console.log(<?php echo json_encode($array); ?>)
its printing js array
Also when I try print_r($array) in backend it prints
[array] => Array
(
[0] => A
[1] => B
[2] => C
)
Thanks in advance