![]() |
creating a json structure - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: creating a json structure (/showthread.php?tid=77617) |
creating a json structure - richb201 - 09-24-2020 I am using fusionAuth. The way it works is that I need to create a json structure called a request, Here is an example of one. Any idea how to create one in CI? Code: { RE: creating a json structure - InsiteFX - 09-24-2020 Create it using an associated array then json_encode it. RE: creating a json structure - nc03061981 - 09-24-2020 I think: $root = [ 'data' = [ ], 'status' = '', '...' = '...' ]; return json_encode($root); RE: creating a json structure - remesses_thegreat - 09-24-2020 (09-24-2020, 01:05 PM)richb201 Wrote: I am using fusionAuth. The way it works is that I need to create a json structure called a request, Here is an example of one. Any idea how to create one in CI?Depending on your source of information this is how i do it: Code: $response = [ If you not looping through data i guess you will know what to do. |