PHP Function Reference

PHP stream_is_local() Function



The PHP stream_is_local() function checks if a stream, or a URL, is a local stream or not.

Syntax

stream_is_local(stream)

Parameters

stream Required. Specify the stream resource or URL to check.

Return Value

Returns true on success or false on failure.

Example: stream_is_local() example

The example below shows the usage of stream_is_local() function.

<?php
var_dump(stream_is_local("http://example.com"));
var_dump(stream_is_local("/etc"));
?>

The output of the above code will be:

bool(false)
bool(true)

❮ PHP Streams Reference