Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Determine if string exists in input string

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 85
    Comment on it

    You can determine particular string exist in an input string with the help of strpos function. strpos returns false if the string is not found. It provides 0 if found at the beginning of string. It finds the position of occurrence of string within another string.

    if(strpos($filename, $match) !== false)
            {
            // $match is present in $filename
            }
        else 
           {
           // $match is not present in $filename 
           }
    

    Its syntax is given below

    strpos(string,find,start) 
    

    Where string requires the string to search, find specifies the string to find and starts specifies the position form where to begin the search.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
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: