development:php:regex

Split string using RegEx

$cols=preg_split('/(?<="),(?=")/', trim($row));
// Loop through items
foreach ($cols as $col) {
 echo $col;
}

make sure to add / to the beginning and the end of your RegEx expression

Enter your comment:
M B᠎ B B Y
 
  • development/php/regex.txt
  • Last modified: 2019-10-31 09:05
  • (external edit)