wp_is_stream() – Test if a given path is a stream URL

You appear to be a bot. Output may be restricted

Description

Tests if a given path is a stream URL

Usage

$bool = wp_is_stream( $path );

Parameters

$path
( string ) required – The resource path or URL.

Returns

bool True if the path is a stream URL.

Source

File name: wordpress/wp-includes/functions.php
Lines:

1 to 12 of 12
function wp_is_stream( $path ) {
  $scheme_separator = strpos( $path, '://' );

  if ( false === $scheme_separator ) {
    // $path isn't a stream.
    return false;
  }

  $stream = substr( $path, 0, $scheme_separator );

  return in_array( $stream, stream_get_wrappers(), true );
}
 

 View on GitHub View on Trac