Answers for "how to response file content to json php"

PHP
2

php file get content json

$json = file_get_contents('php://input',true);
$post = json_decode($json,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
Posted by: Guest on October-01-2021
0

convert text file to json php

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

Code answers related to "how to response file content to json php"

Browse Popular Code Answers by Language