Longhorn PHP 2025 - Call For Papers

stream_context_get_options

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

stream_context_get_options获取资源流/数据包/上下文的参数

说明

stream_context_get_options(resource $stream_or_context): array

返回指定资源流或者上下文的数组参数。

参数

stream_or_context

获取参数信息的 stream 或者 context

返回值

返回一个包含有原参数的关联数组。

示例

示例 #1 stream_context_get_options() 的例子

<?php
$params
= array("method" => "POST");

stream_context_set_default(array("http" => $params));

var_dump(stream_context_get_options(stream_context_get_default()));

?>

以上示例的输出类似于:

array(1) {
  ["http"]=>
  array(1) {
    ["method"]=>
    string(4) "POST"
  }
}

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant