Please tell me how you can break this line:
[[1000,1500,5000,10000,19000,6000],[5,20,30,40,50,60]] in two arrays? I read that it is possible with the help of a regular expression, but with me it’s not very regular.
Please tell me how you can break this line:
[[1000,1500,5000,10000,19000,6000],[5,20,30,40,50,60]] in two arrays? I read that it is possible with the help of a regular expression, but with me it’s not very regular.
This is a typical JSON string. Apply the json_decode() function to it.
$str = '[[1000,1500,5000,10000,19000,6000],[5,20,30,40,50,60]]'; $arr = json_decode($str, false, 3); if (!$arr) die(json_last_error_msg()); var_dump($arr); Regulars are not needed here. Just convert the JSON string to an array:
$json_string = '[[1000,1500,5000,10000,19000,6000], [5,20,30,40,50,60]]'; $arr = json_decode($json_string); Source: https://ru.stackoverflow.com/questions/579802/
All Articles