find length of string in php
<?php
$name = 'abcdef';
echo strlen($str); // 6
$string = ' ab cd ';
echo strlen($str); // 7
?><?php
$str = 'php';
echo strlen($str); // 3
$str = 's p a c e';
echo strlen($str); // 9
?>/*
To measure the length of string there is built-in function in php which returns the exact length of string.
*/
Syntax:
strlen(paramenter);
<?php
$name = 'ankur';
echo "Name Length : ".strlen($name); // Name Length : 5
$message = 'Welcome greppers !';
echo "Message Length : ".strlen($message); // Message Length : 18
?>
/*
I hope it will help you.
Namaste
*/
Also in PHP:
- 500 SERVER ERROR from laravel
- clear config cache laravel
- <?PHP>
- failed to clear cache laravel
- enable error reporting on a page php
- date plus 7 days php
- USA format date in php
- Your Composer dependencies require the following PHP extensions to be installed: fileinfo
- Carbon\Carbon::today()->format('Y-m-d') in blade
- count characters laravel
- 3 random numbers in php
- fetch data from live website curl php
- contains php
- date du jour en php
- checking type of variable in php
- custom time format php
- $headder in php
- echo date php format
- base64_decode php online
- base64 to image
- ctrl + d in vscode in phpstorm
- check if all values in array are equal php
- datetime form of date in php
- comment code in php blade