I have an array as,
either
eight
einstein
eighth
When I convert it to json using json_encode I get the below output,
["either","eight","einstein","eighth"]
But I would like to have a structure like below
[
{"name":"either"},
{"name":"eight"},
{"name":"einstein"},
{"name":"eighth"}
]
How to get such a json? is there any function in php to achieve this functionality?