Ad Code

Ticker

6/recent/ticker-posts

Php script to find out length of the string

In programming some time use the string length for many type of operations like trimming string, coping, replacing and many other tasks which have required to get the string length. 


Php script to find out length of the string

For calculating string length using php here have a single function name is strlen() function, which is use to calculate string length.

Syntax:-

strlen(string)

this function argument single and its take string type values.

If string is empty then it returns 0.

For example:-

String:- This is my first program

And strlen("This is my first program")

see the resutl:-

<?php
echo strlen("This is my first program");
?>

#output
24

This program is find out the length of the string pass in the function argument.

Post a Comment

0 Comments

Ad Code