Answers for "how to create json file in php"

PHP
1

open json file php

// Get the contents of the JSON file 
$strJsonFileContents = file_get_contents("css-color-names.json");
var_dump($strJsonFileContents); // show contentsCopy
Posted by: Guest on June-19-2021
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
2

how to receive json data in php

$data = json_decode(file_get_contents('php://input'), true);
print_r($data);
echo $data;
Posted by: Guest on November-01-2020

Code answers related to "how to create json file in php"

Browse Popular Code Answers by Language