Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Make associative icon array ('icon_class'=> 'Icon Name' paired) from css classes indexed array.
function chaoz_icon_array($k) {
$v = array();
foreach ($k as $kv) {
$kv = str_replace('-', ' ', $kv);
$kv = str_replace('icon', '', $kv);
$v[] = array_push($v, ucwords($kv));
foreach($v as $key => $value) if($key&1) unset($v[$key]);
return array_combine($k, $v);
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.