get characters from number in php code example
Example 1: how to check php string length
<?php
$name = 'abcdef';
echo strlen($str);
$string = ' ab cd ';
echo strlen($str);
?>
Example 2: get number of chars ina string php
$name = "Perú";
echo strlen($name);
$name = "Peru";
echo strlen($name);
Example 3: string length in php
Syntax:
strlen(paramenter);
<?php
$name = 'ankur';
echo "Name Length : ".strlen($name);
$message = 'Welcome greppers !';
echo "Message Length : ".strlen($message);
?>
Example 4: print only some characters of a string in php
substr(string,start,length)