Answers for "how to make a json object in php"

PHP
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
-1

how to make a json request in php

<?php
$jsonurl = "http://api.wipmania.com/json";
$json = file_get_contents($jsonurl);
var_dump(json_decode($json));
?>
Posted by: Guest on April-26-2020

Code answers related to "how to make a json object in php"

Browse Popular Code Answers by Language