Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #array #longest #string
ADD COMMENT
Topic
Name
7+1 =