Forum Moderators: coopster

Message Too Old, No Replies

How do I split a string delimited by a comma?

         

YorkshireSteve

6:33 pm on Aug 12, 2003 (gmt 0)

10+ Year Member



Hi,

How do I split a string delimited by a comma? I can't seem to escape by using

explode(\,,$options);
[ and
explode(,,$options);
wouldn't work anyway. Surely it's an easy thing to do...?

Steve.

YorkshireSteve

6:35 pm on Aug 12, 2003 (gmt 0)

10+ Year Member



Ignore this... Sorry folks!

The answer would be

explode(",",$options);

Ever had one of those days?!

bcolflesh

6:35 pm on Aug 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



us4.php.net/split

brotherhood of LAN

7:18 pm on Aug 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



preg_split("','",$options);

does it too. Nice thing about it is you can use regex, maybe if you wanted to only split every second comma for instance.