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';
using rtrim replaces all "." at the end, not just the last character
$string = "something here..";
echo preg_replace("/\.$/","",$string);