libxml_set_streams_context
(PHP 5, PHP 7)
libxml_set_streams_context — 次のlibxmlドキュメントの読込/書きこみのためにストリームコンテキストを設定する
説明
libxml_set_streams_context
( resource
$streams_context
) : void次のlibxmlドキュメントの読込/書きこみのためにストリームコンテキストを設定します。
返り値
値を返しません。
例
例1 libxml_set_streams_context() の例
<?php
$opts = array(
'http' => array(
'user_agent' => 'PHP libxml agent',
)
);
$context = stream_context_create($opts);
libxml_set_streams_context($context);
// HTTPによりファイルをリクエスト
$doc = DOMDocument::load('http://www.example.com/file.xml');
?>