Question #6094
Submitted by Answiki
on 04/19/2022 at 08:14:58 PM UTC
How to remove the first character of a string in PHP?
Merged questions
Answer
Submitted by Answiki
on 04/19/2022 at 08:16:25 PM UTC
In PHP, the substr() function is the best way to delete the first characters of a string:
// Delete the first character of $string
$string = substr($string, 1);
// The following example displays bcdef :
echo substr('abcdef', 1);
Answer by Answiki on 04/19/2022 at 08:16:25 PM
In PHP, the substr() function is the best way to delete the first characters of a string:
// Delete the first character of $string
$string = substr($string, 1);
// The following example displays bcdef :
echo substr('abcdef', 1);
Question by Answiki 04/19/2022 at 08:14:58 PM
How to remove the first character of a string in PHP?
| # | ID | Query | URL | Count |
|---|---|---|---|---|
| 0 | 13568 | alphons | https://en.ans.wiki/6094/how-to-remove-the-first-character-of-a-string-in-php | 1 |
| 1 | 12723 | en | https://en.ans.wiki/6094/how-to-remove-the-first-character-of-a-string-in-php | 8 |
Icons proudly provided by Friconix.