Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<table><?php
$css_file = 'foo/bar.css';
$css = file_get_contents($css_file);
preg_match_all('/([a-zA-Z-]+)\:(.+)\;/', $css, $matches);
$totals = array();
foreach ($matches[0] as $match)
{
if (!isset($totals[$match])) $totals[$match] = 0;
$totals[$match]++;
}
arsort($totals);
foreach ($totals as $key => $count)
{
echo '<tr>';
echo '<td>' . $key .'</td>';
echo '<td>' . $count .'</td>';
echo '</tr>';
}
?>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.