Posts

Showing posts with the label PHP strlen() Function

PHP strlen() Function

Image
PHP strlen() Function PHP strlen() function is an in-built function of PHP that returns the length of the input string and this string works as a parameter and revert returns its length. It measures the length of string included whitespace and special characters. Syntax : strlen($string) Parameter Values This strlen() function gets only one parameter $string that is mandatory. This parameter represents the string whose length is needed to be returned. Here is an example of strlen() function in PHP: <html> <body> <?php echo strlen("PHPTPOINT"); ?> </body> </html> Output: 9 Here is an another example of strlen() function in PHP: <html> <body> <?php $str = "Hello Everyone!! Welcome to PHPTPOINT.."; echo strlen($str);  // whitespaces and special chars are also counted ?> </body> </html> Output: 39 Also Learn - PHP empty() function