I have this PHP array:
$a = array(
"french"=>"bonjour",
"italian"=>"buongiorno",
"spanish"=>"buenos dias"
);
But when I do echo json_encode($a);
, I get:
{
"french": "bonjour",
"italian": "buongiorno",
"spanish": "buenos dias"
}
i.e. a JSON object, but I want a JSON array, at the expense of preserving the string keys, like that :
[
"bonjour",
"buongiorno",
"buenos dias"
]
How should I do it?