Home Tutorial Php Phpbasics Tutorial PHP String Length

 
 

PHP String Length
Posted on: February 24, 2010 at 12:00 AM
Advertisement
In this current tutorial we will study how to get the length of a string using strlen() function. Examples will help you to learn this in depth.

PHP String Length:

It is a common string operation to find out the length of a string, format of the function is:

int strlen ( string $string ):

In the above function length of the string is returned in integer format. It also includes blank spaces.

PHP String Length Example:

<?php

$string="This is a String";

$len=strlen($string);

echo $lenl;

?>

Output:

16

Example:

<?php

$string="RoseIndia";

$len=strlen($string);

echo $len;

?>

Output:

9

 

Advertisement

Related Tags for PHP String Length:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 24, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com