public static function stringStartsWith($str, $prefix)
    {
        if(is_array($prefix)){
            foreach($prefix as $p){
                if($p === "" || strpos($str, $p) === 0){
                    return true;
                };
            }
            return false;
        }
        return $prefix === "" || strpos($str, $prefix) === 0;
    }
public static function stringStartsWith($str, $prefix)
    {
        if(is_array($prefix)){
            foreach($prefix as $p){
                if($p === "" || strpos($str, $p) === 0){
                    return true;
                };
            }
            return false;
        }
        return $prefix === "" || strpos($str, $prefix) === 0;
    }
public static function stringStartsWith ( $ str , $ prefix ) { if ( is_array ( $ prefix ) ) { foreach ( $ prefix as $ p ) { if ( $ p === "" || strpos ( $ str , $ p ) === 0 ) { return true ; } ; } return false ; } return $ prefix === "" || strpos ( $ str , $ prefix ) === 0 ; }
Does a string start with another string?

@param string $str    The string to check
@param string|array $prefix The prefix to check for
@return bool
Does a string start with another string?