delete last word after / php code example
Example 1: remove last letter php
<?php
echo substr('abcdef',0, -1); // abcde
?>
Example 2: php string remove last character
substr(string $string, int $start, int[optional] $length=null);
<?php
echo substr('abcdef',0, -1); // abcde
?>
substr(string $string, int $start, int[optional] $length=null);