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 Link to comment https://forums.phpfreaks.com/topic/193662-displaying-text-field/ 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); Link to comment https://forums.phpfreaks.com/topic/193662-displaying-text-field/#findComment-1019371 Share on other sites More sharing options...
abhinavsingh89 Posted February 28, 2010 Author Share Posted February 28, 2010 thnx a lot... problem solved Link to comment https://forums.phpfreaks.com/topic/193662-displaying-text-field/#findComment-1019372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.