PHP/fx/stream notification callback: Difference between revisions

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Created page with "{{fmt/title|PHP function: <code>stream_notification_callback()</code>}} ==Links== ===Official=== * php.net: [https://www.php.net/manual/en/function.stream-notification-callbac..."
 
No edit summary
Line 1: Line 1:
{{fmt/title|PHP function: <code>stream_notification_callback()</code>}}
{{fmt/title|PHP function: <code>stream_notification_callback()</code>}}
==About==
This is the prototype for a callback function. A user-function using this same format will be called when any of several different events occur on a stream.
The user's function can be activated as a stream's callback by first creating a context that uses it:
$ctx = stream_context_create();
[[../stream_context_set_params/]]($ctx, array("notification" => "stream_notification_callback"));
...and then opening the stream using that context.
==Links==
==Links==
===Official===
===Official===
* php.net: [https://www.php.net/manual/en/function.stream-notification-callback.php stream_notification_callback()]
* php.net: [https://www.php.net/manual/en/function.stream-notification-callback.php stream_notification_callback()]

Revision as of 22:36, 10 February 2026

Template:Fmt/title

About

This is the prototype for a callback function. A user-function using this same format will be called when any of several different events occur on a stream.

The user's function can be activated as a stream's callback by first creating a context that uses it:

$ctx = stream_context_create();
[[../stream_context_set_params/]]($ctx, array("notification" => "stream_notification_callback"));

...and then opening the stream using that context.

Official