Having problems with regular expressions with preg_split in PHP

zhlovezl

New Member
I have the following input:a few words - 25some more - words - 7another - set of - words - 13And I need to split into this:\[code\][0] = "a few words"[1] = 25[0] = "some more - words"[1] = 7[0] = "another - set of - words"[1] = 13\[/code\]I'm trying to use preg_split but I always miss the ending number, my attempt:\[code\]$item = preg_split("#\s-\s(\d{1,2})$#", $item->title);\[/code\]
 
Back
Top