Answers for "how to represent json in php"

PHP
5

php return json

header('Content-type: application/json');
echo json_encode($array);
Posted by: Guest on March-20-2020
0

convert text file to json php

<?php
  header('Content-type: application/json');
  echo json_encode( explode("\r\n",file_get_contents('data.txt')) );
?>
Posted by: Guest on November-04-2020

Code answers related to "how to represent json in php"

Browse Popular Code Answers by Language