修改端口以啟動(dòng)多個(gè)實(shí)例?
你可以參考一下這個(gè)
修改端口:
https://stackoverflow.com/a/2...
啟動(dòng)多實(shí)例:
https://complete-concrete-con...
ajax 請(qǐng)求接口,要獲取返回值,一定要加
async:false,
type: "post",
dataType: "json",
我覺得這樣寫會(huì)清楚一些:
<?php
$str1 = "01 ";
$str1++;
var_export($str1);//得到'01 '
$str2 = "01";
$str2++;
var_export($str2);//得到2
參見這里的解釋:
PHP follows Perl's convention when dealing with arithmetic operations on character variables and not C's. For example, in PHP and Perl $a = 'Z'; $a++; turns $a into 'AA', while in C a = 'Z'; a++; turns a into '[' (ASCII value of 'Z' is 90, ASCII value of '[' is 91). Note that character variables can be incremented but not decremented and even so only plain ASCII alphabets and digits (a-z, A-Z and 0-9) are supported. Incrementing/decrementing other character variables has no effect, the original string is unchanged.
大意是說,使用自增/自減操作字符串時(shí),可以遞增但不能遞減,另外只支持(字符串的末位為)純 ASCII 字母和數(shù)字 (a-z、a-z 和 0-9)。(另外注意這段中文文檔和英文的對(duì)不上,暫且以英文為準(zhǔn))
傳入匿名函數(shù),匿名函數(shù)里面有自己的參數(shù)。調(diào)用的時(shí)候傳參。
application\config.php
// 應(yīng)用調(diào)試模式
'app_debug' => true,
strace -iT -p pid
win下apache是多線程模式,建議使用apache訪問靜態(tài)文件試試
更新----------------------------------------------------
在Process Monitor的options中選擇select columns,在其中打開
如圖,比較completion time中與上一個(gè)時(shí)間間隔較長(zhǎng)的操作
order_id > 4300284 and order_id < 4300263
你的條件寫錯(cuò)了吧4300284
4300263
swoole是運(yùn)行在cli模式下的。
if (isset($a->$b->c)) {
...
}
可以調(diào)用百度或者高德api逆向查詢經(jīng)緯度
我大概懂了,你看是不是以下你想要的結(jié)果.
$str = <<<EOF
{
"msg": "ok",
"status": 1,
"data": {
"id": 155,
"title": "自家的蘋果",
"content": "<p>自家的,要的聯(lián)系,包郵。</p>",
"create_time": "2018-01-26 17:24:55",
"avatar": "https://think.weipintui.com/uploads/20180126/f9a31f83b9ba56afeaddfb8b708692a9.png",
"pics": [
{
"url": "https://think.weipintui.com/uploads/20180126/da426c2213b9653450e5752b4eb20509.png"
},
{
"url": "https://think.weipintui.com/uploads/20180126/bd6cde8ed6a0cb8b3bcb336c19f0d5ae.png"
},
{
"url": "https://think.weipintui.com/uploads/20180126/681eec67bbfa5ad4b370fae019e45ea2.png"
}
]
}
}
EOF;
$data = json_decode($str,true);
$data = $data['data'];
// 這里是去除掉pics下面的url
$data['pics'] = array_column($data['pics'],'url');
print_r($data);exit;
打印得到的結(jié)果
Array
(
[id] => 155
[title] => 自家的蘋果
[content] => <p>自家的,要的聯(lián)系,包郵。</p>
[create_time] => 2018-01-26 17:24:55
[avatar] => https://think.weipintui.com/uploads/20180126/f9a31f83b9ba56afeaddfb8b708692a9.png
[pics] => Array
(
[0] => https://think.weipintui.com/uploads/20180126/da426c2213b9653450e5752b4eb20509.png
[1] => https://think.weipintui.com/uploads/20180126/bd6cde8ed6a0cb8b3bcb336c19f0d5ae.png
[2] => https://think.weipintui.com/uploads/20180126/681eec67bbfa5ad4b370fae019e45ea2.png
)
)
有點(diǎn)lower,請(qǐng)諒解一下
web目錄下的.htaccsee完整配置,不論是一級(jí)域名還是二級(jí)域名都可以訪問,已經(jīng)經(jīng)過測(cè)試:
Options +FollowSymlinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
RewriteRule \.svn\/ /404.html
RewriteRule \.git\/ /404.html
你這是標(biāo)準(zhǔn)的多對(duì)多模型關(guān)聯(lián)
在你的資源Model里定義個(gè)新方法:
public function tags()
{
return $this->belongsToMany('標(biāo)簽Model');
}
然后:
資源Model::query()
->tags()
->whereIn('res_id',[1,3,5])
->orderBy('create_time','desc')
->limit(5)
->get();
2017-12-5
試試:
ResModel::whereHas('knowledge', function ($query) use ($knowledge_ids) {
$query->whereIn('knowledge_id', $knowledge_ids);
})
->orderBy('created_at', 'desc')
->limit(5)
->get();
所謂的php只渲染模板是指路由還是PHP控制然后render頁面,數(shù)據(jù)靠發(fā)送http請(qǐng)求,往JAVA寫的api之類的獲取還是怎么樣
一般有PHP
棧了, 很少很少會(huì)融入Java
棧,如果二者都有,那么一般指的是PHP
拿到請(qǐng)求,對(duì)請(qǐng)求解析,從Java
中調(diào)用業(yè)務(wù)所需API
最后返回給web
服務(wù)器,這么做對(duì)目的限于分布式集群中,Java
主演的更后端,對(duì)性能要求更大,擁有更多調(diào)用系統(tǒng)API的最最最后端
你的變量$ceshi好像錯(cuò)了我改了一下,不知道對(duì)不對(duì)
//錯(cuò)誤的
$ceshi='優(yōu)酷視頻$$第1集$http://v.youku.com/$youku#第2集$http://v.youku.com/v_show$youku#第3集$http://v.youku.com/$$$芒果視頻$$第1集$http://vmguo.com$mgtv#第2集$http://v.mangguo.com$mgtv#第3集$http://v.mangguo.com$mgtv';
//我?guī)湍阈薷牧?,其中少?youku這一部分
$ceshi='優(yōu)酷視頻$$第1集$http://v.youku.com/$youku#第2集$http://v.youku.com/v_show$youku#第3集$http://v.youku.com/$youku$$$芒果視頻$$第1集$http://vmguo.com$mgtv#第2集$http://v.mangguo.com$mgtv#第3集$http://v.mangguo.com$mgtv';
$result_array = array();
$temp = explode('$$$',$ceshi);
//var_dump($temp);
foreach($temp as $key=>$value){
$temp_array = (explode('$$',$value));
//當(dāng)前的類別
$category = $temp_array[0];
//內(nèi)容再次進(jìn)行歸類
$temp_array = explode('#',$temp_array[1]);
foreach($temp_array as $key=>$value){
//當(dāng)前的集數(shù)
$temp_value = explode('$',$value);
$ep_number = preg_replace('/(第)||(集)/','',$temp_value[0]);
//需要壓入的數(shù)組
$temp_result['siteSource']= $temp_value[2];
$temp_result['siteName']= $category;
$temp_result['siteLink']= $temp_value[1];
//壓入結(jié)果數(shù)組
$result_array["sitePerEpisode"][$ep_number][]=$temp_result;
}
}
//$result_array為你要的結(jié)果,你可以var_dump看一下
//var_dump($result_array);
//將結(jié)果數(shù)組轉(zhuǎn)化為json,中文字符會(huì)被轉(zhuǎn)化
$json_result = json_encode($result_array,true);
echo $json_result;
未轉(zhuǎn)化為json的array結(jié)果
array(1) {
["sitePerEpisode"]=>
array(3) {
[1]=>
array(2) {
[0]=>
array(3) {
["siteSource"]=>
string(5) "youku"
["siteName"]=>
string(12) "優(yōu)酷視頻"
["siteLink"]=>
string(19) "http://v.youku.com/"
}
[1]=>
array(3) {
["siteSource"]=>
string(4) "mgtv"
["siteName"]=>
string(12) "芒果視頻"
["siteLink"]=>
string(16) "http://vmguo.com"
}
}
[2]=>
array(2) {
[0]=>
array(3) {
["siteSource"]=>
string(5) "youku"
["siteName"]=>
string(12) "優(yōu)酷視頻"
["siteLink"]=>
string(25) "http://v.youku.com/v_show"
}
[1]=>
array(3) {
["siteSource"]=>
string(4) "mgtv"
["siteName"]=>
string(12) "芒果視頻"
["siteLink"]=>
string(20) "http://v.mangguo.com"
}
}
[3]=>
array(2) {
[0]=>
array(3) {
["siteSource"]=>
string(5) "youku"
["siteName"]=>
string(12) "優(yōu)酷視頻"
["siteLink"]=>
string(19) "http://v.youku.com/"
}
[1]=>
array(3) {
["siteSource"]=>
string(4) "mgtv"
["siteName"]=>
string(12) "芒果視頻"
["siteLink"]=>
string(20) "http://v.mangguo.com"
}
}
}
}
解決了。creatHtmlTree()
方法中把static $htmlTree
去掉就可以了;
完整版函數(shù):
function creatHtmlTree($tree)
{
$htmlTree = '<ul>';
foreach ($tree as $key => $value) {
$htmlTree .= "<li><span><i class='icon-folder-open'></i>{$value['name']} </span> <a href=''>Goes somewhere</a>";
if (isset($value['childs']) && is_array($value['childs'])) {
$html = creatHtmlTree($value['childs']);
$htmlTree .= $html;
}
$htmlTree .= "</li>";
}
$htmlTree .= "</ul>";
return $htmlTree;
}
首先看一下你的html標(biāo)簽閉合是否正確。然后檢查一下是否存在全局問題事件監(jiān)聽,如$document.on(click)等。最后,如果使用jQuery 控制單選復(fù)選,最好使用attr和prop兩個(gè)方法同時(shí)控制其狀態(tài)。
原因是你的服務(wù)器裝了2個(gè)版本的php
ps:樓上的是個(gè)可行辦法,不過如果php5.3版本沒用,我建議直接卸載掉5.3即可
::)我的服務(wù)器里面也安裝了兩個(gè)版本的php,和你的情況一樣,不過業(yè)務(wù)需要2個(gè)版本而已~
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問,美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。