I would like to convert a comma separated list to an array.
$myList = "value1, value2, value3, ...";
$myArray = listToArray($myList);
I don't see a native function for this, but being inexperienced with PHP, I may have missed it. I could build it with regular expressions, but thought this must be a pretty common function, so I thought I would check here first.
Greg Alton
listToArray()
Moderator: General Moderators
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
Code: Select all
$myArray = explode(", ", $myList);-
justgetaway
- Forum Newbie
- Posts: 3
- Joined: Tue Jul 09, 2002 2:04 pm