Count of sub | Function to return the count of possible sub - strings of length n ; Driver code
< ? php function countSubStr ( $ str , $ n ) { $ len = strlen ( $ str ) ; return ( $ len - $ n + 1 ) ; } $ str = " geeksforgeeks " ; $ n = 5 ; echo ( countSubStr ( $ str , $ n ) ) ; ? >