Skip to content

Instantly share code, notes, and snippets.

@woodwardtw
Created June 17, 2022 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woodwardtw/352c6f930abc8b30b47a321f2c0d16f4 to your computer and use it in GitHub Desktop.
Save woodwardtw/352c6f930abc8b30b47a321f2c0d16f4 to your computer and use it in GitHub Desktop.
index builder for sensus access data
<h1>SensusAccess Stats Index</h1>
<?php
function create_file_name($string){
$name = str_replace('middlebury-report-','', $string);
$name = substr($name,0,10);
return $name;
}
$files = scandir('.');
//var_dump($files);
foreach ($files as $key => $file) {
$clean_name = create_file_name($file);
if(strlen($clean_name)>3 && $clean_name != '.htaccess' && $clean_name != 'data.php'){
echo "<a href='{$file}''>{$clean_name}</a></br>";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment