count the no of characters in a string in phph
/*
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:
- Increase the PHP memory limit
- clear cach php artisan
- email configuration for gmail in laravel
- check if a word is present inside a string in php
- Laravel route not calling function of controller
- find first occurance of sentence in a string php
- /laravel-2020-07-27.log" could not be opened
- enable all errors php
- To find out where your php.ini is located
- How to print an error to the console in PHP
- apache php e_warnings e_notice off
- cache laravel
- Illuminate\Database\QueryException SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))
- check if string contains a character php
- ?name="" value in php
- convert uppercase to capitalize in php
- create a random string in php
- acf add options page to custom post type
- What is a Regular Expression in php
- ata date format in php
- codeigniter echo last query
- alias seeddb='php artisan db:seed'
- cache clear in cpde php laravel
- fetch value from json link in php