Skip to content

Instantly share code, notes, and snippets.

@edmondscommerce
Created April 18, 2011 13:50
Show Gist options
  • Save edmondscommerce/925374 to your computer and use it in GitHub Desktop.
Save edmondscommerce/925374 to your computer and use it in GitHub Desktop.
some snippets
<?php
$glob = glob('zblog/application/views/scripts/*');
//var_dump($glob);
foreach ($glob as $g) {
if (!is_readable($g)) {
continue;
}
echo '<h1>' . $g . '</h1>
<table>
<tr><th>name</th><th>size</th><th>lines</th></tr>';
$glob2 = glob($g . '/*');
//var_dump($glob2);
foreach ($glob2 as $g2) {
if (!is_readable($g2)) {
continue;
}
if (is_dir($g2)) {
continue;
}
$name = basename($g2);
$size = filesize($g2);
$lines = count(file($g2));
echo "<tr><td>$name</td><td>$size</td><td>$lines</td></tr>";
}
echo '</table>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment