$type would need to have more than a true/false value.
you could do something like
Code:
switch ($type) {
case 0:
$sentence = "$word1[0] $word2[0] $word3[0] $word4[0]";
break;
case 1:
$sentence = "$word1[0] $word2[0] $word3[0] $word4[0] $word5[0]";
break;
case 2:
asdfhaskdhflasjdhflashdf
break;
default:
asdjhflasjhdfljashdflkjhasdf
break;
}
Then you just have to set $type to something other than 0/1 or false/true.