stream_context_set_default

PHP 5 >= 5.3.0, PHP 7, PHP 8
stream_context_set_default - Set the default stream context
Manual
Code Examples

stream_context_set_default( array$options ): resource

Set the default stream context which will be used whenever file operations (fopen, file_get_contents, etc...) are called without a context parameter. Uses the same syntax as stream_context_create.

Parameters

options

The options to set for the default context.

Note:

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

Return Values

Returns the default stream context.

Related Functions

Example of stream_context_set_default

Show all examples for stream_context_set_default

PHP Version:


Function stream_context_set_default:

Streams Functions

Most used PHP functions