ggggggggg ggggggggg - 1 year ago 95
PHP Question

PHP - How to remove all specific characters at the end of a string?

How to remove the last character only if it's a period?

$string = "something here.";
$output = 'something here';

Answer Source
$output = rtrim($string, '.');

(Reference: rtrim on

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download