Contact: aviboots(AT)netvision.net.il
39,900 questions
51,831 answers
573 users
function shortest_word_length($s) { return min(array_map(function($word) { return strlen($word); }, explode(' ', $s))); } $str = 'php java go c++ python'; echo shortest_word_length($str); /* run: 2 */