How to remove the last character only if it's a period?
$string = "something here.";
$output = 'something here';
How to remove the last character only if it's a period?
$string = "something here.";
$output = 'something here';
$output = rtrim($string, '.');
(Reference: rtrim on PHP.net)