0

hello,
i have store value in database like this in only one field.

one.
two.
three.

but i am retriveing from database that is displaying like this

one.two.three.

but i want same format.like in database

one.
two.
three.
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by cwarn23
0

If you mean all of the values are stored in the one cell or variable then the following will do the trick:

$var='one.two.three.';
$var=substr($var,0,-1);
$arr=explode('.',$var);
for ($i=0;isset($arr[$i]);$i++) {
echo $arr[$i].'<br>';
}

That is just from the top of my head and may or may not have bugs. Hope it helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.