php convert array to json object
snippet in php

php convert array to json object

user4433

$myArr = array("apple", "banana", "mango", "jackfruit");

$toJSON = json_encode($myArr);

echo $toJSON;