(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
stream_context_set_option — 對(duì)資源流、數(shù)據(jù)包或者上下文設(shè)置參數(shù)
$stream_or_context,$wrapper,$option,$value$stream_or_context, array $options): bool
給指定的上下文設(shè)置參數(shù)。參數(shù) value
是設(shè)置 wrapper 的 option 參數(shù)的值。
stream_or_context需要添加參數(shù)的資源流或者上下文。
wrapper封裝協(xié)議的名稱(可能與協(xié)議不同)。 請(qǐng)參考 上下文(Context)選項(xiàng)和參數(shù) 查看資源流參數(shù)列表。
option選項(xiàng)的名稱。
value選項(xiàng)的值。
options
給 stream_or_context 設(shè)置的選項(xiàng)。
注意:
options必須是一個(gè)$arr['wrapper']['option'] = $value格式二維關(guān)聯(lián)數(shù)組 。請(qǐng)參考 上下文(Context)選項(xiàng)和參數(shù) 查看資源流參數(shù)列表。
成功時(shí)返回 true, 或者在失敗時(shí)返回 false。