String Replace

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

String Replace

Post by iknownothing »

Hey Guys,

I have a textbox where the client can enter in a multi-lined address. On submission, the textbox and databse both hold the separate lines, but when I put it into HTML, the lines die. I have used:

Code: Select all

str_replace("\n", "<br>", $theaddress);
but it doesn't seem to be working. Is there another way? Thanks.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

Post by iknownothing »

wow, i can't get over how simple that is, thanks Kieran!
Post Reply