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.
- How to remove portion of a string after a certain character in PHP?
- How to Remove Special Character from String in PHP ?
- Replace every character of string by character whose ASCII value is K times more than it
- Queries to find the last non-repeating character in the sub-string of a given string
- Remove characters from a numeric string such that string becomes divisible by 8
- Change string to a new character set
- Find last index of a character in a string
- How to remove extension from string in PHP?
- Remove new lines from string in PHP
- Removing occurrences of a specific character from end of a string in PHP
- Convert a String to Character array in Java