PHP strlen() string function

The PHP strlen() function returns the string length, means count of character string contain.

Here we take an example of count character of given string using strlen() function.

PHP strlen() function syntax

strlen(“string”);

PHP strlen() function example

The output of above strlen() function example is:

The length of string = 13

Now, lets more understand about php strlen() function with php example.

In this php example we enter value in textbox and calculated length of entered text using php strlen() function in php form.

PHP example of strlen() function

create php form with name firstexample.php look like  :

The above php strlen() function example out put is:

PHP strlen() string function

PHP strlen() string function

Here, above example when we enter “Meera Academy” text in textbox then the out put is length= 13 and for “jay” the length=3.

Next php tutorial we will learn php substr() function.

Leave a Reply

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

8 + 7 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">