count string php
<?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
?>$name = "Perú"; // With accent mark
echo strlen($name); // Display 5, because "ú" require 2 bytes.
$name = "Peru"; // Without accent mark
echo strlen($name); // Display 4<?php
$name = 'abcdef';
echo strlen($str); // 6
$string = ' 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
*/
Also in PHP:
- codeigniter where_not_in
- display error php
- date add php
- add header image to woocomerce shop page
- determine the date format from a string php
- date parameter in php
- check key in array php
- check if key of array key true or false php
- fetch data from phpmyadmin
- auto refresh page in php
- composer create-project laravel 6
- errpr reporting in php
- _e in wordpress
- check if array key exists php
- adding days in date, php
- It is possible to perform an HTTPS redirect using PHP code as well as writing PHP code to prevent the browser from caching your we
- data type checking php
- add a day in date function in php
- date php D
- codeigniter 3 update
- catch all exceptions php
- call php function in js
- date_default_timezone_set for india in php laravel
- add one day to date in php