KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've a MySQL database from which I extract a string which is a list of words separated by newline. Now I want to remove only the trailing newline. I tried using preg_replace as $string = preg_replace('/\n/','',$string); It works, but all the newlines in the strings are removed :( How can I do this?
Tags (comma-separated)
Save Edits
Cancel