Php how to remove any last commas [duplicate] May 25, 2023 by Tarik rtrim('test,,,,,', ','); See the manual.