Show Output
Using Different Start and Length Values in substr_count()
"; // Prints: 34 // The string is reduced to 'woodpeckers', so it prints 1 echo substr_count($str, $substr, 4, 11)."
"; // The string is reduced to 'the wood', so it prints 1 echo substr_count($str, $substr, -10, 9)."
"; // The string is reduced to 'live in', so it prints 0 echo substr_count($str, $substr, 16, 7); ?>