Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php array longest string

  // Convert array to an array of string lengths
$lengths = array_map('strlen', $data);

  // Show min and max string length
echo "The shortest is " . min($lengths) .
     ". The longest is " . max($lengths);
Comment

PREVIOUS NEXT
Code Example
Php :: append file in php 
Php :: php get current time and date 
Php :: laravel restore soft delete 
Php :: mysql_fetch_array php 
Php :: laravel model is dirty 
Php :: laravel with where has 
Php :: str_replace php 
Php :: laravel loop counter 
Php :: laravel set config value runtime 
Php :: laravel validation unique if this field is changed 
Php :: laravel migration change column default 
Php :: how to replace multiple characters in a string in php 
Php :: count remaining days php 
Php :: php mongodb version cmd 
Php :: get url with php 
Php :: laravel query by relationship 
Php :: laravel pagination with get parameters 
Php :: php shell command execution 
Php :: laravel datatable format date column 
Php :: composer create project laravel 
Php :: phpcs 
Php :: how send user to 404 page if not exist page in laravel 
Php :: php empty object 
Php :: laravel foreign key constraint 
Php :: guzzlehttp form data 
Php :: php sort multi dimensional array 
Php :: php use variable as object key 
Php :: cloudflare country 
Php :: using php, how to create a folder in another folder 
Php :: php pdo database connection 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =