Hi,
with the code below the output is sort by $verantw but $title and
$file in the same row DON'T belong to $verantw.
How do I have to make the sort command that $verantw, $title and $file
in the row "belongs together"?
Hope you understand my problem......
<?php
$handle = opendir('.');
$daten = array();
$daten['files'] = array();
$daten['title_tags'] = array();
$daten['verantw'] = array();
while ($file = readdir($handle )) {
if (substr($file, -4) == '.htm') {
$daten['files'][] = $file;
$html = file_get_conten ts('./' . $file);
preg_match_all( '/!!!!(.*)!!!!/', $html, $matches);
if (isset($matches[1][0])) {
$daten['verantw'][] = $matches[1][0];
}
preg_match_all( '!<title>([^<]+)</title>!i', $html, $matches);
if (isset($matches[1][0])) {
$daten['title_tags'][] = $matches[1][0];
}
}
}
sort($daten['verantw']);
$nr = 0;
$max = count($daten['verantw']);
for ($i = 0; $i < $max; $i++) {
echo "<tr>";
echo "<td class=\"text\" width=\"4%\">". ++$nr."</td>";
echo "<td class=\"text\" width=\"28%\">< a class=\"link\"
href=\"".$daten['files'][$i]."\"
target=\"_blank \">".$daten['files'][$i]."</a></td>";
echo "<td class=\"verantw \" width=\"25%\">" ;
if ($daten['verantw'][$i]) echo $daten['verantw'][$i];
else echo ' ';
echo "</td>";
echo "<td class=\"text\" width=\"35%\">" ;
if ($daten['title_tags'][$i]) echo $daten['title_tags'][$i];
else echo ' ';
echo "</td>";
......
?>
with the code below the output is sort by $verantw but $title and
$file in the same row DON'T belong to $verantw.
How do I have to make the sort command that $verantw, $title and $file
in the row "belongs together"?
Hope you understand my problem......
<?php
$handle = opendir('.');
$daten = array();
$daten['files'] = array();
$daten['title_tags'] = array();
$daten['verantw'] = array();
while ($file = readdir($handle )) {
if (substr($file, -4) == '.htm') {
$daten['files'][] = $file;
$html = file_get_conten ts('./' . $file);
preg_match_all( '/!!!!(.*)!!!!/', $html, $matches);
if (isset($matches[1][0])) {
$daten['verantw'][] = $matches[1][0];
}
preg_match_all( '!<title>([^<]+)</title>!i', $html, $matches);
if (isset($matches[1][0])) {
$daten['title_tags'][] = $matches[1][0];
}
}
}
sort($daten['verantw']);
$nr = 0;
$max = count($daten['verantw']);
for ($i = 0; $i < $max; $i++) {
echo "<tr>";
echo "<td class=\"text\" width=\"4%\">". ++$nr."</td>";
echo "<td class=\"text\" width=\"28%\">< a class=\"link\"
href=\"".$daten['files'][$i]."\"
target=\"_blank \">".$daten['files'][$i]."</a></td>";
echo "<td class=\"verantw \" width=\"25%\">" ;
if ($daten['verantw'][$i]) echo $daten['verantw'][$i];
else echo ' ';
echo "</td>";
echo "<td class=\"text\" width=\"35%\">" ;
if ($daten['title_tags'][$i]) echo $daten['title_tags'][$i];
else echo ' ';
echo "</td>";
......
?>
Comment