通常是由于windows系统不能验证对方网站的CA(数字证书)
可以加这条语句解决:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //不要验证SSL
通常是由于windows系统不能验证对方网站的CA(数字证书)
可以加这条语句解决:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //不要验证SSL
<? | |
function detect_city($ip) { | |
$default = 'UNKNOWN'; | |
if (!is_string($ip) || strlen($ip) < 1 || $ip == '127.0.0.1' || $ip == 'localhost') | |
$ip = '8.8.8.8'; | |
$curlopt_useragent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)'; | |
<? | |
set_time_limit(0); | |
include 'runtime.php'; | |
/** | |
* 使用多个子连接读同时读取多个连接 | |
*/ | |
function multiCurl($urls) | |
{ | |
// 构建 $multi_handle |
1. 首先是同服务器的不同DB | |
在模型的__define() 里面增加 | |
'table_config' => array( | |
'schema' => 'dbname', | |
), | |
2. 其次是不同服务器的DB | |
EXCEL导出XML结构:如果用于程序,如果打不开,出错的地方可能在于 | |
1. Row index。删了,并补上空白行<Row /> | |
2. <Table> 中的 ExpandedRowCount, ExpandedColumnCount。删了 | |
3. WorksheetOptions标签里的内容,可能会导致WPS出错 | |
4. 没有使用htmlspecialchars函数转换特别字符,WPS会出错 | |
5. 数字类型的格填入了文字 | |
6. 注意换行符"\r\n"之类要换成" " |
<? | |
/** | |
* @sample | |
* [code] | |
* $excel = new ExcelOutput(); | |
* $excel->start(); | |
* | |
* // ... page content in html format comes here | |
* | |
* $e->save(); |
/** | |
* @sample | |
* [code] | |
* $excel = new ExcelOutput(); | |
* $excel->start(); | |
* | |
* // ... page content in html format comes here | |
* | |
* $e->save(); | |
* [/code] |
function _request($service, $method, $param = array()){ | |
// sys config, values comes from win.vjia.com | |
$auth['Uname'] = 'username'; | |
$auth['Password'] = 'password'; | |
// method config | |
// $wsdl_uri = "http://sws2.vjia.com/swsmsTest/{$service}.asmx?wsdl"; // sandbox | |
$wsdl_uri = "http://sws2.vjia.com/swsms/{$service}.asmx?wsdl"; // production | |
$client = new SoapClient($wsdl_uri, array('trace'=>true, 'exceptions'=>true, 'style'=>SOAP_DOCUMENT, 'encoding'=>'UTF-8', 'soap_version'=>SOAP_1_1)); |
functin joinPath($a, $b){ | |
return rtrim($a, '/\ ') . DIRECTORY_SEPARATOR . ltrim($b, '/\ '); | |
} |
<?php | |
function dump($var, $label = null){ | |
if($label) echo "<b>$label</b>"; | |
echo '<pre>'; | |
print_r($var); | |
echo '</pre>'; | |
} | |
class Runtime | |
{ |