Test Design Patterns (alphabetical)
$i=2;
$tekst= "";
while ($i<$aantalfiles){
$zk=$files[$i];
$tkst=file("data/".$zk);
$naam=trim($tkst[1]);
$naam=str_replace ("", "", $naam);
$naam=str_replace ("
", "", $naam);
$tkst=implode($tkst);
//nu naar h3 zoeken:
$tkst2=explode("",$tkst);
$aantaltp=count($tkst2);
$j=1;
while ($j<$aantaltp){
$tp=explode("
",$tkst2[$j]);
//
$anaam=str_replace ("The ", "", $tp[0]);
$anaam=str_replace (" ", "-", $anaam);
$anaam=str_replace ('"', '', $anaam);
//-----------
$lb=$lb." ".$tp[0];
$lb=$lb." (";
$lb=$lb."";
$lb=$lb.$naam;
$lb=$lb."";
$lb=$lb.")\n";
$j=$j+1;
}
$type=explode(".",$zk);
$type=$type[count($type)-1];
//if ($zk=="" or $type==$zk or $zk==$naam){
$lm = date ('d-M-Y H:i', filectime ('data/'.$files[$i]));
$sz = intval(filesize ('data/'.$files[$i])/1024)."k";
$zoek=$files[$i];
//$tekst=$tekst.$i."-".$aantaltp.$lb;
//$tekst=$tekst."\n";
//$tekst=$tekst.(substr(" ",strlen($naam))).$lm;
//$tekst=$tekst.(substr(" ",strlen($sz))).$sz." (".(filesize ('data/'.$files[$i])).")\n";
//}
$i=$i+1;
}
$lb=str_replace ("The ", "", $lb);
$lb=explode("\n",$lb);
sort($lb);
$i=0;
$lb2="";
$skip="";
$aantaltp=count($lb);
while ($i<$aantaltp){
if ($skip<>substr($lb[$i],4,1)){
$skip=substr($lb[$i],4,1);
$lb2=$lb2."\n";
}
$lb2=$lb2.$lb[$i]."\n";
$i=$i+1;
}
//echo implode("\n",$lb);
echo $lb2;
?>