abhinavsingh89 Posted February 28, 2010 Share Posted February 28, 2010 hey frnds!! i have a text field in my mysql database which contains paragraphs n includes new line (\n) characters. now when i echo that field it simply shows all the data in one line.. that is it doesnt take into account the new line characters and tab spaces. I have inserted the value with tab spaces and new line as it automatically takes the \n and \r. Now what i want to do is display the text properly and same as what i have inserted. so cn u guys help me.. Thnx in advance Abhinav Quote Link to comment Share on other sites More sharing options...
jl5501 Posted February 28, 2010 Share Posted February 28, 2010 you can handle the newlines with nl2br(); The spaces need to be converted to to be effective, and if they are tab characters, this may work $output = str_replace("\t",' ',$output); Quote Link to comment Share on other sites More sharing options...
abhinavsingh89 Posted February 28, 2010 Author Share Posted February 28, 2010 thnx a lot... problem solved 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.