Forums
This topic is locked
i need to get strings seperated by comma
Posted 04 Sep 2006 08:09:23
1
has voted
04 Sep 2006 08:09:23 hari Rajamoni posted:
i need to get the string seperated by comma in php . how can i get it.for example
delhi,mumbai means i have to get the delhi and mumbai seperately
pls help me
Replies
Replied 04 Sep 2006 10:49:28
04 Sep 2006 10:49:28 Patrick Woldberg replied:
You can use the split function to seperate the string by comma, it returns an array with all the values
<pre id=code><font face=courier size=2 id=code>$values = "delhi,mumbai";
$arr = split(",", $values);
echo $arr[0]; // delhi
echo $arr[1]; // mumba</font id=code></pre id=code>
--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Administrator at DMXzone.com, FLzone.net, FWzone.net and DNzone.com
--------------------------------------------------
<pre id=code><font face=courier size=2 id=code>$values = "delhi,mumbai";
$arr = split(",", $values);
echo $arr[0]; // delhi
echo $arr[1]; // mumba</font id=code></pre id=code>
--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Administrator at DMXzone.com, FLzone.net, FWzone.net and DNzone.com
--------------------------------------------------