Skip to content

Instantly share code, notes, and snippets.

@mdjwel
Created July 24, 2018 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdjwel/b1b73e505cca3f918e37210c6741e623 to your computer and use it in GitHub Desktop.
Save mdjwel/b1b73e505cca3f918e37210c6741e623 to your computer and use it in GitHub Desktop.
Convert icon classes to icon names.
<?php
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