<?php $s = "5,test2,4631954,Y,«some, string, text.»,299.00 TJS,http://some-link";print_r(preg_split('~«[^«»]*»(*SKIP)(*F)|\s*,\s*~u', $s));
Standard input is empty
Array ( [0] => 5 [1] => test2 [2] => 4631954 [3] => Y [4] => «some, string, text.» [5] => 299.00 TJS [6] => http://some-link )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!