# PHP: remove 1 character

**URL:** <https://forum.kirupa.com/t/php-remove-1-character/205672>\
**Category:** programming\
**Created:** [October 31, 2006, 9:14pm UTC](https://forum.kirupa.com/t/php-remove-1-character/205672 "2006-10-31T21:14:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zero\_one1](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/zero_one1/32/948_2.png) [@zero\_one1](https://forum.kirupa.com/u/zero_one1)\
**Post date:** [October 31, 2006, 9:14pm UTC](https://forum.kirupa.com/t/php-remove-1-character/205672/1 "2006-10-31T21:14:51Z")

</div>

in PHP i need to delete 1 character from a string eg:

$string1 = “abcde”  
…becomes…  
$string1 = “abcd”

I was thinking of getting the length of the string and then deleting the last character, but can’t remember of there’s a function in PHP with which i can delete a single character.

any help!!??
