remove last and first character from string if equal php code example Example: remove first letter php <?php echo substr('abcdef', 1); // bcdef ?>