Eureka Moment Wiki

One eureka moment at the time

User Tools

Site Tools


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:
W L᠎ H I D
development/php/regex.txt · Last modified: 2019/10/31 09:05 (external edit)