How do I remove a whitespace at the end of a word and not from the middle of the word?
rtrim().
rtrim()
Manual reference: String functions in PHP
548k questions
547k answers
4 comments
86.3k users