$s = "php python c++ c c# java";
$words = explode(" ", $s);
$max = "";
$min = $s;
foreach ($words as &$w)
{
if (strlen($w) > strlen($max)) $max = $w;
if (strlen($w) < strlen($min)) $min = $w;
}
echo "The largest word is: " . $max . "<br />";
echo "The smallest word is: " . $min . "<br />";
/*
run:
The largest word is: python
The smallest word is: c
*/