The json_decode function can be used as shown below −
json_decode($json_string_that_needs_to_be_converted, true);
The below lines of code can be used to convert JSONL to array format −
$json_string = '["[email protected]","[email protected]","[email protected]"]'; $array_of_data=json_decode($json_string);
An alternate is to use the below code, wherein the way json_string has been defined changes −
Example
$json_string = "[\"[email protected]\",\"[email protected]\",\"[email protected]\"]"; $array_of_data=json_decode($json_string);
Output
This will produce the following output −
Array("[email protected]","[email protected]","[email protected]")