public static function smartExplode($string)
    {
        if (empty($string))
            return array();

        if (is_array($string))
            return $string;

        if (!is_array($string)) {
            if (strpos($string, ';') !== false)
                return explode(';', trim($string, ';'));

            if (strpos($string, ',') !== false)
                return explode(',', trim($string, ','));
        }

        return (array)$string;
    }
public static function smartExplode($string)
    {
        if (empty($string))
            return array();

        if (is_array($string))
            return $string;

        if (!is_array($string)) {
            if (strpos($string, ';') !== false)
                return explode(';', trim($string, ';'));

            if (strpos($string, ',') !== false)
                return explode(',', trim($string, ','));
        }

        return (array)$string;
    }
public static function smartExplode ( $ string ) { if ( empty ( $ string ) ) return array ( ) ; if ( is_array ( $ string ) ) return $ string ; if ( ! is_array ( $ string ) ) { if ( strpos ( $ string , ';' ) !== false ) return explode ( ';' , trim ( $ string , ';' ) ) ; if ( strpos ( $ string , ',' ) !== false ) return explode ( ',' , trim ( $ string , ',' ) ) ; } return ( array ) $ string ; }
Explodes a string into an array split upon ';' or ',' characters

@param string $string The string to *EXPLODE*

@return array
Explodes a string into an array split upon ; or characters