Remove first 4 characters of a string with PHP

How can I remove the first 4 characters of a string using PHP?

Answer

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."

Leave a Reply

Your email address will not be published. Required fields are marked *