I want to replace the extra space at the end of the string with nothing using preg_replace in PHP. I was creating a big database of words and somehow a few word
preg_replace
why not just use trim() http://php.net/manual/en/function.trim.php