php remove last element string code example
Example 1: remove last letter php
<?php
echo substr('abcdef',0, -1); // abcde
?>
Example 2: php remove last character from string
$hell = substr('hello', 0, -1);
<?php
echo substr('abcdef',0, -1); // abcde
?>
$hell = substr('hello', 0, -1);