How can I remove the first 4 characters of a string using PHP?
Asked
Active
Viewed 3.9e+01k times
2 Answers
504
You could use the substr
function to return a substring starting from the 5th character:
$str = "The quick brown fox jumps over the lazy dog."
$str2 = substr($str, 4); // "quick brown fox jumps over the lazy dog."

Daniel Vandersluis
- 91,582
- 23
- 169
- 153