How to get the shortest string length from an array of strings in PHP

1 Answer

0 votes
$arr = array("php", "c++", "python", "javascript", "c", "java");

$arr_len = array_map('strlen', $arr);

echo min($arr_len);


/*
run:

1
 
*/

 



answered Mar 2, 2019 by avibootz
...