(PECL getdns >= 0.10.0)
php_getdns_util_convert_array — Convert a PHP array to a getdns dictionary or list.
$phpArray
, int &$dictOrList
)This function converts a PHP array to a getdns dictionary or list. The value returned depends on the type of array passed to the function. An indexed array will be converted to a list. An associative array will be converted to a dictionary. Sub-arrays will be also be converted to the corresponding getdns data type.
phpArray
The PHP array to be converted to a dictionary or list. Arrays may contain integers (which will be converted to the getdns t_int data type), strings (which will be converted to the getdns t_bindata data type), and arrays (which will be converted to either a t_dict or a t_list depending on the array type).
dictOrList
The reference to the returned getdns dictionary or list. Note that this argument is passed by reference and any existing value will be overwritten. The caller is responsible for freeing the getdns dictionary or list using php_getdns_dict_destroy() or php_getdns_list_destroy() as appropriate.
This function returns an integer response code. GETDNS_RETURN_GOOD indicates successful completion.