$contactA){ echo ''; if( $A > 0 ) echo ''.$contactA[1].' '.$contactA[2].''; else echo ''; foreach($contacts as $B=>$contactB){ if( $B < count($contacts)-1 ){ if( $A == 0 ) echo ''.$contactB[1].' '.$contactB[2].''; else if( $B < $A ) echo ""; else echo ""; echo ''; }} echo ''; } ?>