Jump to content

return json output without square brakets


php_begins

Recommended Posts

I am returning the following through JSON:

 

$this->view->lead_query=$lead_query->fetchALL();
header('OK', true, 200);
header('Content-type: application/json');
echo json_encode($this->view->lead_query);

 

I am getting the results in this format:

[{"client_name":"Steve Harris","state":"TX"}]

 

Now if the above output was displayed without the square brackets [] I can populate the values in my form correctly.

Is there a way i can return the output without the square brackets?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.