reg exp (splitting a string)
Moderator: General Moderators
reg exp (splitting a string)
How can i use regular expressions to split a string into parts based on commas or spaces and copy the parts into a array? or is there a built in php function that does this?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Try explode():
http://www.php.net/manual/en/function.explode.php
or preg_split():
http://www.php.net/manual/en/function.preg-split.php
Mac
http://www.php.net/manual/en/function.explode.php
or preg_split():
http://www.php.net/manual/en/function.preg-split.php
Mac