Andrew R Posted September 25, 2008 Share Posted September 25, 2008 Probably a really easy one. In a database I have the following: Name: Andrew*Age: 20* How in php would I take a new line after the * (asterix)? What function would I use? Many thanks Quote Link to comment Share on other sites More sharing options...
ratcateme Posted September 25, 2008 Share Posted September 25, 2008 if all you wanted to do was turn * into a new line you could do $string = str_replace("*","\n",$string); Scott. Quote Link to comment Share on other sites More sharing options...
F1Fan Posted September 25, 2008 Share Posted September 25, 2008 Or if you wanted to keep the asterisk: $string = str_replace("*","\n*",$string); Quote Link to comment Share on other sites More sharing options...
Andrew R Posted September 25, 2008 Author Share Posted September 25, 2008 Thanks a million. I couldn't get "\n" to take a new line for some reason so I added in <br> Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.