← All docs

stream_context_set_option()

Sets an option on the specified context.

stream_context_set_option()

function stream_context_set_option(resource $context, string $wrapper_or_options, string $option_name = null, mixed $value = null): bool

Sets an option on the specified context.

Parameters:

  • $context (resource)
  • $wrapper_or_options (string)
  • $option_name (string), default null, optional
  • $value (mixed), default null, optional

Returns: bool

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how stream_context_set_option is implemented in the compiler, see the internals page.