Answers for "php array longest string"

PHP
0

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);
Posted by: Guest on September-15-2021

Code answers related to "php array longest string"

Browse Popular Code Answers by Language