How do I remove the last character only if it's a period?
$string = "something here."; $output = 'something here';
$output = rtrim($string, '.');
(Reference: rtrim on PHP.net)
2.1m questions
2.1m answers
60 comments
57.0k users