alphadeltaviii Posted February 23, 2008 Share Posted February 23, 2008 Ok, i am using FCKeditor to submit values into my DB, but i am writing a script to edit these values. FCKeditor will not work if there are line-breaks in the code, so is there any way to remove them with php? Quote Link to comment Share on other sites More sharing options...
drisate Posted February 23, 2008 Share Posted February 23, 2008 yes use trim() Quote Link to comment Share on other sites More sharing options...
alphadeltaviii Posted February 23, 2008 Author Share Posted February 23, 2008 so for example trim($variable) ? Quote Link to comment Share on other sites More sharing options...
teng84 Posted February 23, 2008 Share Posted February 23, 2008 try this... echo str_replace("\n","","Hello \n!"); Quote Link to comment Share on other sites More sharing options...
drisate Posted February 23, 2008 Share Posted February 23, 2008 Would that work even if theres no \n apparent in the database? ex: this is my value thats would be trim() or the \n replace? Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted February 23, 2008 Share Posted February 23, 2008 both examples will work, and the \n doesnt have to be in the database because it represents a line break so when you tell PHP to look for \n it doesnt look for those characters it looks for a line break Quote Link to comment Share on other sites More sharing options...
drisate Posted February 23, 2008 Share Posted February 23, 2008 thats great thx :-) 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.