Remove the very first character of a given string in PHP
Input : Geeksforgeeks Output : eeksforgeeks Input :, Hello geek! Output : Hello geek!
In PHP to remove characters from beginning we can use ltrim but in that we have to define what we want to remove from a string i.e. removing characters are to be known.
If string is not known and we want to remove characters from beginning then we can use substr(). Here we can use it by two parameters one is the string and the other is the index. substr() return string from the second parameter index to the end of the string.
- Replace every character of string by character whose ASCII value is K times more than it
- Remove characters from a numeric string such that string becomes divisible by 8
- Change string to a new character set
- Remove new lines from string in PHP
- How to remove extension from string in PHP?
- Find last index of a character in a string
- Program to remove consonants from a String
- Count occurrences of a sub-string with one variable character
- Lexicographically smallest string formed by removing at most one character
- Rearrange a string in the form of integer sum followed by the minimized character
- Form N-copy string with add, remove and append operations
- Remove characters from string that appears strictly less than K times
- How to remove underline for anchors tag using CSS?
- PHP | Ds\Vector remove() Function
- PHP | Ds\Deque remove() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.