本文整理汇总了PHP中http::fetchtext方法的典型用法代码示例。如果您正苦于以下问题:PHP http::fetchtext方法的具体用法?PHP http::fetchtext怎么用?PHP http::fetchtext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类http
的用法示例。
在下文中一共展示了http::fetchtext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: msetcookie
msetcookie('08cms_msgcode', authcode("{$timestamp}\t{$msgcode}", 'ENCODE'));
$info = array('time' => -1, 'text' => str_replace('%s', $msgcode, $msgcode_msg));
} elseif ($msgcode_mode == 2) {
list($inittime, $initcode) = maddslashes(explode("\t", @authcode($m_cookie['08cms_msgcode'], 'DECODE')), 1);
if ($timestamp - $inittime > 60) {
$msg = str_replace('%s', $msgcode, $msgcode_sms);
if ($mcharset != 'gbk' || $mcharset != 'gb2312') {
include M_ROOT . 'include/charset.fun.php';
$msg = convert_encoding($mcharset, 'gb2312', $msg);
}
$msg = rawurlencode($msg);
$url = $msgcode_gate == 1 ? "http://sms.eshang8.cn/api/?esname={$id}&key=pw&phone={$mobile}&msg={$msg}&smskind=1" : "http://service.winic.org/sys_port/gateway/?id={$id}&pwd={$pw}&to={$mobile}&content={$msg}&time={$timestamp}";
include M_ROOT . 'include/http.cls.php';
$http = new http();
$http->timeout = 60;
$msg = $http->fetchtext($url);
if ($msgcode_gate == 1) {
$msg = $msg === '0';
} else {
$msg = explode("/", $msg);
$msg = $msg[0] === '000';
}
if ($msg) {
msetcookie('08cms_msgcode', authcode("{$timestamp}\t{$msgcode}", 'ENCODE'));
} else {
$info = array('time' => -1, 'text' => 'msgcode_send_err');
}
} else {
$info = array('time' => 1, 'text' => 'donot_repeat_operate');
}
}
示例2: onepage
function onepage($url)
{
global $mcharset, $progress;
$m_http = new http();
$m_http->timeout = $this->gmission['timeout'] ? $this->gmission['timeout'] : 0xffff;
if ($this->gmission['mcookies']) {
$m_http->setCookies($this->gmission['mcookies']);
}
$html = $m_http->fetchtext($url);
unset($m_http);
$html = convert_encoding($this->gmission['mcharset'], $mcharset, $html);
$this->clean_blank($html);
$progress && $progress->pagecount(1);
return $html;
}