ellandrd
asked on
insert br at comma
how can i insert a <br> where a "comma" appears in a string?
my string example: this is, the string, i want, to, break, up
result show look like:
this is
the string
i want
to
break
up
ellandrd
my string example: this is, the string, i want, to, break, up
result show look like:
this is
the string
i want
to
break
up
ellandrd
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
echo str_replace(',','<br>',$st r);
I would go with aminerd solution, even when you don't use xhtml at this stage.
-r-
-r-
ASKER
why aminerd? there is nothing different!
The difference is between <br/> (mine) and <br> (dedo's): one is valid XHTML, the other is not. Possibly not that big of a deal for you, but a difference nonetheless. :-)