<?php
$input = 'color=blue,red,weight=100kg,another=one,two,three,four,okay=enough,';
var_export(preg_split('~,(?=[^,]+=)~', rtrim($input, ','), 0, PREG_SPLIT_NO_EMPTY));
- Output for 7.1.25 - 7.1.30, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
- array (
0 => 'color=blue,red',
1 => 'weight=100kg',
2 => 'another=one,two,three,four',
3 => 'okay=enough',
)
preferences:
159.37 ms | 403 KiB | 176 Q