wp_is_stream( string $path )

Test if a given path is a stream URL


Parameters

$path

(string) (Required) The resource path or URL.


Return

(bool) True if the path is a stream URL.


Source

File: wp-includes/functions.php

function wp_is_stream( $path ) {
	if ( false === strpos( $path, '://' ) ) {
		// $path isn't a stream
		return false;
	}

	$wrappers    = stream_get_wrappers();
	$wrappers    = array_map( 'preg_quote', $wrappers );
	$wrappers_re = '(' . join( '|', $wrappers ) . ')';

	return preg_match( "!^$wrappers_re://!", $path ) === 1;
}


Changelog

Changelog
Version Description
WP-3.5.0 Introduced.