php remove last 4 chars from string code example Example: php remove last character from string $hell = substr('hello', 0, -1);