find number of characters in a string in PHP

find number of characters in a string in PHP

In this post we will give you information about find number of characters in a string in PHP. Hear we will give you detail about find number of characters in a string 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 find the number of characters in a string of text. It also includes the white spaces inside the specified string.


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



<?php
$my_str1 = 'The quick brown fox jumps over the lazy dog.';
echo strlen($my_str1); // Outputs: 44
 
$my_str2 = '    The quick brown fox jumps over the lazy dog. ';
echo strlen($my_str2); // Outputs: 49
?>


 

Hope this and post will helped you for implement find number of characters in a string 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 *

1  +  4  =  

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