downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

HttpRequest::addHeaders> <HttpRequest
[edit] Last updated: Fri, 17 May 2013

view this page in

HttpRequest::addCookies

(PECL pecl_http >= 0.10.0)

HttpRequest::addCookiesAdd cookies

说明

public bool HttpRequest::addCookies ( array $cookies )

Add custom cookies.

Note: request 选项 encodecookies 控制 cookie 值是否应被 urlencode() 编码。

Note: 影响任意请求方法。

参数

cookies

an associative array containing any cookie name/value pairs to add

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #1 A HttpRequest::addCookies() example

<?php
$r 
= new HttpRequest;
$r->addCookies(
    array(
        
"cookie_name" => "cookie value",
    )
);
?>

参见



add a note add a note User Contributed Notes HttpRequest::addCookies - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites