JSON Code Generator?

2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 25, 2020   (RSS)

By Dave - October 25, 2020

Hi Tim, 

What about something like this? 

<?php
// example.json.php 

// data stored in array
$array = Array (   
"0" => [ "id" => "01", "name" => "Tim Mason",         "designation" => "System Architect",  ],   
"1" => [ "id" => "02", "name" => "Jennifer Laurence", "designation" => "Senior Programmer", ],   
"2" => [ "id" => "03", "name" => "Medona Oliver",     "designation" => "Office Manager",    ],
);

// output as json
header('Content-Type: application/json');
print json_encode($array);

// eof
Dave Edis - Senior Developer
interactivetools.com