check lenght in php
/*
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
*/$name = "Perú"; // With accent mark
echo strlen($name); // Display 5, because "ú" require 2 bytes.
$name = "Peru"; // Without accent mark
echo strlen($name); // Display 4
Also in PHP:
- date formats in php date
- check codeigniter version of a project
- date manual php
- check if string contains word php
- Illuminate\Contracts\Container\BindingResolutionException Target class [SlugController] does not exist.
- catch get error php
- check if string is not in other string php
- creating seeder in laravel
- PHP Warning: Module 'soap' already loaded in Unknown on line 0
- creating thumbnail in codeigniter
- find number of characters in word php
- call table seeder laravel
- cacert file_get_contents openssl
- carbon add minutes
- $time = date('r') php
- convert string date to timestamp php
- composer clear cache
- echo date php format
- base encode64 php image
- array_reverse in php example
- Carbon\Carbon::today()->format('Y-m-d') in blade
- composer install laravel installer
- $pwd = $this->generateRandomString($length = 8); error
- check if array key exists php