本文整理匯總了PHP中Browser::cookies_set方法的典型用法代碼示例。如果您正苦於以下問題:PHP Browser::cookies_set方法的具體用法?PHP Browser::cookies_set怎麽用?PHP Browser::cookies_set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Browser
的用法示例。
在下文中一共展示了Browser::cookies_set方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: cacheurl
function cacheurl($url, $browser_req = true, $cookies = "", $browser = "Firefox")
{
global $myconfig;
#find cache file
$hash = md5($url);
$datei = "cache/" . $hash;
if (file_exists($datei)) {
if (time() - filemtime($datei) < $myconfig['cachetime']) {
return implode('', file($datei));
}
}
#no cache file exists send browser request
if ($browser_req == true) {
$objekt = new Browser($browser);
if ($cookies != "") {
$objekt->cookies_set($cookies);
}
$objekt->url = $url;
$t_html = $objekt->read();
} else {
$t_html = implode('', file($url));
}
d_write($datei, $t_html);
return $t_html;
}
示例2: myvideo_flv_download
/**
* Parse the video url of a given myvideo video link site
* and returns the http url of the video
* *
* @param string $url
* url of video must contain watch/*
* http://www.myvideo.de/watch/7125794
* @return string
* the url of the video as http url; should the flv file
*/
function myvideo_flv_download($url)
{
preg_match('|watch/(\\d+)/|i', $url, $match);
$objekt = new Browser($browser);
if ($cookies != "") {
$objekt->cookies_set($cookies);
}
$objekt->url = "http://www.myvideo.de/movie/" . $match[1];
$objekt->read();
$head = $objekt->returnHeader();
preg_match('/V\\=(.*?).flv/', $head['Location'], $matches);
return urldecode($matches[1]) . ".flv";
}