ego0 Posted April 2, 2007 Share Posted April 2, 2007 Hey, I want to replace "hi hi" the white space in the above so it looks like this "hi <br /> <br /> <br /> hi" Is this possible? Thank yous. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted April 2, 2007 Share Posted April 2, 2007 um, not sure but look at the strreplace() function ie $s = 'this is a string'; $ns = 'q'; $thing = strreplace('s', $ns, $s); this would make $thing == "thiq iq a qtring" good luck Quote Link to comment Share on other sites More sharing options...
MadTechie Posted April 2, 2007 Share Posted April 2, 2007 erm... what!! another function to look at is trim.. Quote Link to comment Share on other sites More sharing options...
desithugg Posted April 2, 2007 Share Posted April 2, 2007 <? $string = "Helllo, I'm desithugg. Who are you? "; echo nl2br($string); ?> The above would show Hello, I'm desithugg. Who are you? Quote Link to comment Share on other sites More sharing options...
obsidian Posted April 2, 2007 Share Posted April 2, 2007 If you are looking to replace newlines in a textarea input with <br />, then desithugg has the best solution. The function nl2br() is built for just that purpose. 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.