Answers for "write json from php file to page"

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

Browse Popular Code Answers by Language