本文整理汇总了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";
}