stream_context_set_option

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

stream_context_set_option對資源流、數(shù)據(jù)包或者上下文設(shè)置參數(shù)

說明

stream_context_set_option(
    resource $stream_or_context,
    string $wrapper,
    string $option,
    mixed $value
): bool
stream_context_set_option(resource $stream_or_context, array $options): bool

給指定的上下文設(shè)置參數(shù)。參數(shù) value 是設(shè)置 wrapperoption 參數(shù)的值。

參數(shù)

stream_or_context

需要添加參數(shù)的資源流或者上下文。

wrapper

封裝協(xié)議的名稱(可能與協(xié)議不同)。 請參考 上下文(Context)選項和參數(shù) 查看資源流參數(shù)列表。

option

選項的名稱。

value

選項的值。

options

stream_or_context 設(shè)置的選項。

注意:

options 必須是一個 $arr['wrapper']['option'] = $value 格式二維關(guān)聯(lián)數(shù)組 。

請參考 上下文(Context)選項和參數(shù) 查看資源流參數(shù)列表。

返回值

成功時返回 true, 或者在失敗時返回 false