FANDOM


Description Edit

strlen will return the length of the string on success or a 0 if the string is empty.

Parameters Edit

{{{returns}}} strlen (string input)

Parameter Infos Edit

Parameter PHP Version Type
strlen 4 or 5 returns integer
input 5 string


Examples Edit

Example 1: The direct way Edit

<?php
echo strlen("Hello");
?>

Output Edit

5

Example 2: Using a variable Edit

<?php
$string = "ABCDEFG";
echo strlen($string);
?>

Output Edit

7

Example 3: The use of spaces Edit

<?php
// spaces will count too
echo strlen(" Abc 0 Abc ");
?>

Output Edit

11

See also Edit

count, mb_strlen

For more details on this function, visit its entry in the php manual.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.