Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB