getdns Functions
PHP Manual

php_getdns_context_set_update_callback

(PECL getdns >= 0.10.0)

php_getdns_context_set_update_callbackSet a callback function to be called when a context value changes.

Description

int php_getdns_context_set_update_callback ( int $context , array $userArg )

This function sets a callback function in PHP user space that will be called when a context value changes. The callback function must be written to accept two parameters. The first is an integer value that identifies the context element that has been changed. The second is an array that represents the user arguments passed to the php_getdns_context_set_update_callback() function.

Parameters

context

The previously created DNS context that is to be used with this request.

userArg

An indexed array that contains information used to control callback processing. The first element of the array must contain a character string representing the name of the PHP client function that will be called when a context value changes. Additional array elements are optional and may be included to be passed to the callback function. The callback function will receive the complete array for local processing with all elements included as specified.

It's important to understand that the getdns library copies the address of the userArg data structure. Any changes to this value that are made after calling this function may have unintended consequences.

Return Values

This function returns an integer response code. GETDNS_RETURN_GOOD indicates successful completion.


getdns Functions
PHP Manual