• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JSON Output in a Specific Format.

#3
(02-13-2017, 09:50 PM)ciadmin Wrote: You might try
Code:
$names[] = $name;
. That will add an array to $names without an index.

That's perfect.  Thank you!

All I have to do then is add the extra bits and I get the exact output I need:

PHP Code:
     $this->output
          
->set_content_type('application/json')
 
         ->set_output('{"rows":' json_encode($names) . '}'); 

Thank you again!

Steve
Reply


Messages In This Thread
JSON Output in a Specific Format. - by Speed - 02-13-2017, 09:11 PM
RE: JSON Output in a Specific Format. - by Speed - 02-13-2017, 10:04 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.