find string length in PHP

find string length in PHP

In this post we will give you information about find string length in PHP. Hear we will give you detail about find string length in PHPAnd how to use it also give you demo for it if it is necessary.

Use the PHP strlen() function


You can simply use the PHP strlen() function to get the length of a string. The strlen() function return the length of the string on success, and 0 if the string is empty.


Let’s take a look at the following example to understand how it actually works:



<?php
$str1 = 'Hello world!';
echo strlen($str1); // Outputs: 12
echo "<br>";
 
$str2 = ' Hello    world! ';
echo strlen($str2); // Outputs: 17
?>


i hope you like this one.

Hope this and post will helped you for implement find string length in PHP. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

4  +  5  =  

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US