<?php
$input = 'id_order:2,id_account:1,test:'test',id_project:1123';
$chunks = array_chunk(preg_split('/(:|,)/', $input), 2);
$result = array_combine(array_column($chunks, 0), array_column($chunks, 1));
print_r($result);
- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
- Parse error: syntax error, unexpected 'test' (T_STRING) in /in/uHH6l on line 3
Process exited with code 255.
preferences:
170 ms | 1395 KiB | 36 Q