Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2013 21:47
What would you like to do?
$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;
foreach ($totals as $key => $count)
echo '<tr>';
echo '<td>' . $key .'</td>';
echo '<td>' . $count .'</td>';
echo '</tr>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment