fork download
  1. <?php
  2.  
  3. $s = "12v some, Item, which contains comma, Another item";
  4. $res = preg_split('~\s*,(?!\s*\p{Ll})\s*~', $s);
  5. print_r($res);
Success #stdin #stdout 0.03s 82624KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 12v some
    [1] => Item, which contains comma
    [2] => Another item
)