I have the below script which returns CSS files based on production or development environment. The development section is fine; but for production I have to do 2 loops to get the files. Is there a cleaner/better way?function get_css_files(){   $CI =& get_instance();    $return = array();    $css_files = array(        array('path' =>'css/jquery.gritter.css', 'media' => 'all', 'group' => '1.css'),        array('path' =>'css/jquery-ui.css', 'media' => 'all', 'group' => '1.css'),        array('path' =>'css/bootstrap-select.css', 'media' => 'all', 'group' => '1.css'),        array('path' =>'css/select2.css', 'media' => 'all', 'group' => '1.css'),        array('path' =>'css/font-awesome.min.css', 'media' => 'all', 'group' => '1.css'),        array('path' =>'css/jquery.loadmask.css', 'media' => 'all', 'group' => '1.css'),        array('path' =>'css/token-input-facebook.css', 'media' => 'all', 'group' => '1.css'),        array('path' =>'css/KeyTips.min.css', 'media' => 'all', 'group' => '1.css'),        array('path' =>'css/bootstrap-colorpicker.min.css', 'media' => 'all', 'group' => '2.css'),        array('path' =>'css/jquery.ml-keyboard.css', 'media' => 'all', 'group' => '2.css'),    );    if(!defined(ENVIRONMENT) or ENVIRONMENT == 'development')    {        $return = $css_files;    }    else    {        $groups = array();        foreach($css_files as $css)        {            $groups[$css['group']] = TRUE;        }        foreach(array_keys($groups) as $css_group_file)        {            $return[] = array('path' =>css/$css_group_file, 'media' => 'all');        }    }    if(is_rtl_lang())    {        $return[] = array('path' =>'css/rtl.css', 'media' => 'all');    }    return $return;}
Getting CSS files based on production or development
php;css