i have made it even more simple, n no need to update

this will work even after font awesome will add new icons after update
PHP Code:
<?php
/**
* Author: [email protected]
* Date: 8/24/15
* Hope this helps you, please at least leave my name in place
*
* Modified by: [email protected]
* Date: 5/3/16
*/
defined('BASEPATH') OR exit('No direct script access allowed');
if ( ! function_exists('fa_icon'))
{
/**
* Icon
*
* Generates an Font-Awesome icon tag.
*
* @param string icon
* @param string attributes
* @return string
*/
function fa_icon($icon = '', $attributes = '')
{
return '<i class="fa fa-'.$icon.' '.$attributes.'">'.'</i>';
}
}