value(class) * * @param array $array font awesome array. Create it using `getArray` method * @return array */ public function onlyClass($array){ if( ! is_array($array) ) return false;//Do not proceed if is not array $temp = array(); foreach ($array as $class => $unicode) { $temp[$class] = $class; } return $temp; } //------------------------------------//--------------------------------------// /** * Get only the unicode key * * @param array $array font awesome array. Create it using `getArray` method * @return array */ public function onlyUnicode($array){ if( ! is_array($array) ) return false;//Do not proceed if is not array $temp = array(); foreach ($array as $class => $unicode) { $temp[$unicode] = $unicode; } return $temp; } //------------------------------------//--------------------------------------// /** * Readable class name. Ex: fa-video-camera => Video Camera * * @param array $array font awesome array. Create it using `getArray` method * @param string $class_prefix change this if the class names does not start with `fa-` * @return array */ public function readableName($array, $class_prefix = 'fa-'){ if( ! is_array($array) ) return false;//Do not proceed if is not array $temp = array(); foreach ($array as $class => $unicode) { $temp[$class] = ucfirst( str_ireplace(array($class_prefix, '-'), array('', ' '), $class) ); } return $temp; } //------------------------------------//--------------------------------------// /** * Get all icons data. Ex: fa-video-camera => array(...) * * @param array $array font awesome array. Create it using `getArray` method * @param string $class_prefix change this if the class names does not start with `fa-` * @return array */ public function allData($array, $class_prefix = 'fa-'){ if( ! is_array($array) ) return false;//Do not proceed if is not array $temp = array(); foreach ($array as $class => $unicode) { $temp[$class] = array( 'unicode' => $unicode, 'name' => ucfirst( str_ireplace(array($class_prefix, '-'), array('', ' '), $class) ), ); } return $temp; } }