PHP: Remove first Character from String
Question by Guest | 2015-06-08 at 09:44
I would like to cut off the first character from the front of an arbitrary string using PHP.
This first character can be an arbitrary letter or an arbitrary number and also the length of the string can vary.
Does someone know any PHP function for this?
Related Topics
PHP: Remove arbitrary Characters at the Beginning and the End of a String
Tutorial | 0 Comments
JavaScript: Remove last character from string
Tip | 5 Comments
PHP: Check Strings with Ctype-Functions for Character Classes
Article | 0 Comments
PHP: Get first Digit of Number or String
Tutorial | 0 Comments
PHP: Remove all empty elements from string array
Tip | 0 Comments
HTACCESS: Simplify URL
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
You can use the PHP function substr() for this.
Here is a small example:
We have the string "abc" and using substr() we are cutting off the first letter. Therefore, the result will be "bc".
When using another number instead of 1, the corresponding number of characters will be removed instead.
2015-06-09 at 12:21