find length of string php
<?php
$str = 'abcdef';
echo strlen($str); // 6
$str = ' ab cd ';
echo strlen($str); // 7
?>
<?php
$str = 'php';
echo strlen($str); // 3
$str = 's p a c e';
echo strlen($str); // 9
?><?php
$str = 'abcdef';
echo strlen($str); // 6
$str = ' ab cd ';
echo strlen($str); // 7
?>/*
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
*/<?php
$str = 'Hello World!';
echo strlen($str); // 12
?>
Also in PHP:
- ation: 1071 Specified key was too long; max key length is 1000 bytes
- catch new exception php
- check if string contains specific words inr
- PHP echo and print Statements
- como instalar php ubuntu 20.04
- disable updated_at laravel
- Jan 5, 2021 15:37:25 time format php
- array unique values php
- display rounded price get_price php
- composer install laravel global
- check fro some duplicate values in multidimensional array php
- Pacific Daylight Time Zone php
- cache flush laravel
- check typeof variable php
- array duplicating value searching using php
- check for type php
- date to timestamp ph
- error reporting all php
- consolelog is it a thing in php
- age date de naissance php
- check if it's the homepage wordpress
- 01 july 2020 php date format
- errpr reporting in php
- check if string contains char php