count string length in php
<?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
$name = 'abcdef';
echo strlen($str); // 6
$string = ' ab cd ';
echo strlen($str); // 7
?>
Also in PHP:
- find a word in srting php
- check characters php
- Basic features of Exception Handling php
- Illuminate\Http\Request vs \Illuminate\Support\Facades\Request
- cakephp extract array
- convert a image to base64 data in php and show image
- client's ip address in php
- datetime format
- console.log from functions php
- find a specific word in a string and add another string after that specific word php
- count string length in php
- 12th December 2020 date format in php
- change format date usa month text php
- can i back up mysql database from php code?
- array key is true
- datetime::timeformat php
- PHP Deprecated: Function create_function()
- base64_decode laravel
- Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\PPETrackerApp\email.php on line 21
- array_search
- big int php
- Connect to SQL in a php PDO and print the data in it
- find array duplicates in two arrays php
- ddev laravel setup