All pastes #784260 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-19 16:51 UTC
rendered paste body
<?php

$mydir = dir('./');
$col1 = "";
$col2 = "";
$runningtotal = 0;

while(($file = $mydir->read()) !== false) {
	$upper = ucwords($file); 

	if(is_dir($mydir->path.$file)  == true && $file != '.' && $file != '..') {
		$files[] = $file;
	}
}

$mydir->close();

$runningtotal = 0;

foreach ($files as $file) {
	$upper = ucwords($file); 
	
	if ($runningtotal < ((count($files) + 1) / 2)) {
		$col1 .= "<li><font face=verdana size=2><a href='$file'>$upper</a></font></li>";	
	} else {
		$col1 .= "<li><font face=verdana size=2><a href='$file'>$upper</a></font></li>";	
	
	}
}

echo "<div class='col1'>";
echo "<h1>Col 1</h1>";
echo $col1;
echo "</div>";

echo "<div class='col1'>";
echo "<h1>Col 2</h1>";
echo $col2;
echo "</div>";


?>