convert a json to string php code example
Example 1: convert text file to json php
<?php
header('Content-type: application/json');
echo json_encode( explode("\r\n",file_get_contents('data.txt')) );
?>
Example 2: parse json phph
echo json_decode("[1,2,3]")[0];