@orpha
To decode multiple JSON arrays in CodeIgniter, you can follow these steps:
1
|
$this->load->library('json'); |
1 2 3 4 5 |
$json_string = '[{"name":"John","age":30},{"name":"Jane","age":25}]'; $json_arrays = $this->json->json_decode($json_string, true); print_r($json_arrays); |
1 2 3 |
foreach ($json_arrays as $json_array) { echo 'Name: ' . $json_array['name'] . ', Age: ' . $json_array['age'] . '<br>'; } |
By following these steps, you can easily decode multiple JSON arrays in CodeIgniter using the JSON library.