Skip to content

Instantly share code, notes, and snippets.

@GreatPotato
Created June 12, 2013 16:07
Show Gist options
  • Save GreatPotato/5766738 to your computer and use it in GitHub Desktop.
Save GreatPotato/5766738 to your computer and use it in GitHub Desktop.
Get a list of all font awesome icons
<?php
$pattern = '/\.(icon-(?:\w+(?:-)?)+):before\s+{\s*content:\s*"(.+)";\s+}/';
$subject = file_get_contents('css/font-awesome.css');
preg_match_all($pattern, $subject, $matches, PREG_SET_ORDER);
$icons = array();
echo '<ul>';
foreach($matches as $match){
echo '<li><i class="' .$match[1] .'"></i> '.$match[1].'</li>';
}
echo '</ul>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment