public static function random($data = false) {

        if($data) {

            if(Validate::isObject($data)) {

                $data = Format::objectToArray($data);
            }

            if(Validate::isArray($data)) {

                return $data[array_rand($data, 1)];
            } 
        }

        return false;
    }
public static function random($data = false) {

        if($data) {

            if(Validate::isObject($data)) {

                $data = Format::objectToArray($data);
            }

            if(Validate::isArray($data)) {

                return $data[array_rand($data, 1)];
            } 
        }

        return false;
    }
public static function random ( $ data = false ) { if ( $ data ) { if ( Validate :: isObject ( $ data ) ) { $ data = Format :: objectToArray ( $ data ) ; } if ( Validate :: isArray ( $ data ) ) { return $ data [ array_rand ( $ data , 1 ) ] ; } } return false ; }
Return a random value from a given array or object.
@param array || object
@return string random value
Return a random value from a given array or object .