PHP Function Reference

PHP stream_context_get_params() Function



The PHP stream_context_get_params() function retrieves parameter and options information from the specified stream or context.

Syntax

stream_context_get_params(stream_or_context)

Parameters

stream_or_context Required. Specify the stream or context to get parameters from.

Return Value

Returns an associate array containing all context options and parameters.

Example: stream_context_get_params() example

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

<?php
$ctx = stream_context_create();
$params = array("notification" => "stream_notification_callback");
stream_context_set_params($ctx, $params);

var_dump(stream_context_get_params($ctx));
?>

The output of the above code will be:

array(2) {
  ["notification"]=>
  string(28) "stream_notification_callback"
  ["options"]=>
  array(0) {
  }
}

❮ PHP Streams Reference