I posted this question earlier but needed to clarify quite a few things to make it easier for everyone. I'm trying to output this with JSON and nothing I'm doing seems to be working...
{
"request": {
"act": "user_create",
"user_email": "newuser@example.com",
"user_zone": "example.com"
},
"result": "success",
"msg": "A message that will be displayed to the end user"
...
}
Here's the code that I'm currently using:
<?php
$array[0]=array("request"=>array("act"=>'user_create',
"user_email"=>"newuser@example.com",
"user_zone"=>"example.com"));
$array[1]=array('result' => 'success');
$array[2]=array('msg' => 'A message that will be displayed to the end user');
echo json_encode($array);
?>
With that code I am getting this output which is close but not quite there and isn't a valid json output. Not sure what to change but here's what I'm currently getting:
[{"request":{"act":"user_create","user_email":"newuser@example.com","user_zone":"example.com"}},{"result":"success"},{"msg":"A message that will be displayed to the end user"}]
If someone could please post an example of my fixed PHP code that would be great. I've been bouncing back and forth all for the past several hours testing out different solutions and nothing seems to be displaying exactly what I need :/ Thanks in advance!