CakeFest 2024: The Official CakePHP Conference

libxml_set_streams_context

(PHP 5, PHP 7, PHP 8)

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

説明

libxml_set_streams_context(resource $context): void

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

パラメータ

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

?>

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top