Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to use strlen() function in PHP?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 252
    Comment on it

    Hi Reader's,
    Welcome to FindNerd, today we are going to discuss how to use strlen() function in PHP?

    If you want to get the length of your string word then you should use the strlen() function.
    This function is used for getting the length of a string.The strlen() function always returns length of a string when it goes for success and when it goes for empty then it return 0.
    strlen() function also counts whitespaces, exclamation marks and new line characters at the end of a string. 

    Note:-The strlen() function always supports PHP 4+ version.

     Syntax  of the strlen() function


    string is required parameter and specifies the string to check
    you can see below example for better understanding.

    exmaple 1:-

    <!DOCTYPE html>
    echo strlen("Hi mac how are you ?");
    output will come following
     Example 2:-
      $a = "abcdef\n"; 
      echo "<p>".strlen($a)."</p>";   
    Output will come following


 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: