libxml_set_streams_context

(PHP 5)

libxml_set_streams_context --  次のlibxmlドキュメントの読込/書きこみのためにストリームコンテキストを設定する

説明

void libxml_set_streams_context ( resource streams_context )

次のlibxmlドキュメントの読込/書きこみのためにストリームコンテキストを設定します。

パラメータ

streams_context

ストリームコンテキストリソース( stream_context_create()で作成)

返り値

値を返しません。

例 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');

?>

参考

stream_context_create()