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 Link to comment https://forums.phpfreaks.com/topic/125835-formatting-the-output/ 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. Link to comment https://forums.phpfreaks.com/topic/125835-formatting-the-output/#findComment-650678 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); Link to comment https://forums.phpfreaks.com/topic/125835-formatting-the-output/#findComment-650681 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 Link to comment https://forums.phpfreaks.com/topic/125835-formatting-the-output/#findComment-650684 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.