Page 1 of 1

extract string

Posted: Tue Aug 30, 2005 3:02 pm
by anandkanatt
is there any way by which i can extract each word in a string which is separated by a comma??
eg. $string="a,b,c,d,e"

what i want is to extract a b c d e to separate variables?? :?:

Posted: Tue Aug 30, 2005 3:08 pm
by raghavan20
look at split and explode functions

Posted: Tue Aug 30, 2005 3:11 pm
by feyd
be advised, split() uses regular expressions, which means it will be slower than explode(), and slower than preg_split() as well.