PHP 5 >= 5.1.0, PHP 7, PHP 8
stream_context_get_default - Retrieve the default stream context
Code Examples

stream_context_get_default( [array|null$options = null] ): resource

Returns the default stream context which is used whenever file operations (fopen, file_get_contents, etc...) are called without a context parameter. Options for the default context can optionally be specified with this function using the same syntax as stream_context_create.



options must be an associative array of associative arrays in the format $arr['wrapper']['option'] = $value, or null.

Return Values

A stream context resource.


Version Description
8.0.0 options is now nullable.

Related Functions

Example of stream_context_get_default

Show all examples for stream_context_get_default

PHP Version:

Function stream_context_get_default:

Streams Functions

Most used PHP functions