Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • substr_count() string function in php

    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 45
    Comment on it

    The substr_count() in php is a string function which counts the no of times the sub string occurred in the string.
    this function is case-sensitive.

    the syntax of the function is as :


    Here , the string is the string in which the substring is to be count, substring is a string which is to be find.
    the start is the position from where the search is to be started and the length is to specify the length of the search.

    The function returns the number of times the substring appeared in the function.


           $str = "This is good";
           echo substr_count($str,"is",3,3).";

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: