libxml_set_streams_context
libxml_set_streams_context
Set the streams context for the next libxml document load or write
void **libxml_set_streams_context** resource $context
Sets the streams context for the next libxml document load or write.
context
The stream context resource (created with
)
stream_context_create
return.void
Throws a when a non-stream resource is
passed to .
TypeError``context
Voorbeeld: A example
<?php
$opts = [
'http' => [
'user_agent' => 'PHP libxml agent',
]
];
$context = stream_context_create($opts);
libxml_set_streams_context($context);
// request a file through HTTP
$dom = new DOMDocument;
$doc = $dom->load('http://www.example.com/file.xml');
?>
stream_context_create