鍍金池/ 問答/ PHP問答
病癮 回答

如果你問的是php可以使用什么技術(shù)實(shí)現(xiàn)未讀信息,那么建議看下這個(gè)庫:https://www.workerman.net/web...,支持服務(wù)端主動(dòng)向客戶端推送消息,當(dāng)然也支持輪詢的方式。

舊酒館 回答

平臺(tái)途徑:http://www.zbj.com/

還有就是各種QQ群,微信群。。

兮顏 回答

`
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
`
$headers = curl_getinfo($ch, CURLINFO_HEADER_OUT);把headers打印出來可以出加與不加http_build_query()是有區(qū)別的。

離夢 回答

tp5的路由不能分模塊配置
只能把路由規(guī)則全部寫在應(yīng)用目錄下的下面的route.php文件中
可以采用路由分組的方式 來實(shí)現(xiàn)綁定到模塊的效果

Route::group('blog',[
    ':id'   => ['Blog/read', ['method' => 'get'], ['id' => '\d+']],
    ':name' => ['Blog/read', ['method' => 'post']],
]);
陌上花 回答

首先,mb_strpos(string $haystack, string $needle),很明顯你的參數(shù)位置反了。

其次,支持中文基本都是mb_前綴(MultiByte)安全截取,比如 mb_substr, mb_strpos, mb_strstr。

詆毀你 回答
if (isset($redux_inlobase['media-favicon']['url']) && !empty($redux_inlobase['media-favicon']['url']) ) {
                echo $redux_inlobase['media-favicon']['url'];
            } else {
                echo '沒有條目';
   }

不需要forecho

風(fēng)畔 回答

懷疑是 nginx 的 keep alive 的超時(shí)值不足所致。建議延長相關(guān)值??梢宰⒁庥^察下載大文檔時(shí)超過多久時(shí)會(huì)出現(xiàn)這種錯(cuò)誤,這個(gè)超時(shí)的時(shí)間一般固定的。根據(jù)情況增大這個(gè)參數(shù)值
具體設(shè)置可參照這個(gè)鏈接。

你的問題打了 php 的標(biāo)簽,所以你的nginx對(duì)應(yīng)的 upstream 服務(wù)器可能 php-fpm 服務(wù)提供,同樣也要設(shè)置 php.ini 相關(guān)的參數(shù)。

舊言 回答

我改項(xiàng)目路由了。。不用配置了。。

乖乖噠 回答

1.相對(duì)路徑./tools
2.undefined來自于console.log(tools.funs.add(30,2));,其中tools.funs.add(30,2)返回結(jié)果是undefined

舊城人 回答

LIKE '%\\\\u672a\\\\u90fd%';
https://stackoverflow.com/que...

To get the LIKE comparison to match a literal backslash character, we need two backslash characters. As we just demonstrated, to get a backslash character in a string literal requires two backslashes. So we need a total of four backslash characters.

首先很感謝夜影給予的幫助,上述方法真實(shí)可用。下面是我結(jié)合夜影的方法做的一些補(bǔ)充。等于兩種方法都可以解決此類問題,具體請(qǐng)參考:https://www.zkii.net/tech/php...

夏木 回答

是啊,同時(shí)遇到這個(gè)問題,太牛掰了,用php測試,第一次會(huì)是120秒以內(nèi)的時(shí)間斷開,以后每次斷開都是120s,default_socket_timeout 參數(shù)也設(shè)置過了,很尷尬,也是最后發(fā)現(xiàn)telnet竟然也會(huì)斷開,正在尋找原因!

Start:  18:16:32string(24) "read error on connection"

End:    18:17:18
[[[[[ 46 s]]]]]
Start:  18:17:18string(24) "read error on connection"

End:    18:19:18
[[[[[ 120 s]]]]]
Start:  18:19:18string(24) "read error on connection"

End:    18:21:18
[[[[[ 120 s]]]]]
Start:  18:21:18
逗婦乳 回答

foreach裏的元素都是動(dòng)態(tài)渲染的嗎?也就是說button一開始是不存在的咯?
那你的代碼:

$(".openRightLayout").click(function(e) {
  e.preventDefault();
    var id = e.currentTarget.dataset.id;
  $("#service_range").val(id);
});

實(shí)際上就沒有綁定事件成功吧?試試事件委託呢?

$('body').on('click','.openRightLayout',function(){})
話寡 回答

通過查看源碼發(fā)現(xiàn),主動(dòng)依附關(guān)聯(lián)是使用主鍵的。

在 Illuminate\Database\EloquentRelations\BelongsToMany 中的create()方法如下:

public function create(array $attributes = [], array $joining = [], $touch = true)
{
    $instance = $this->related->newInstance($attributes);

    // Once we save the related model, we need to attach it to the base model via
    // through intermediate table so we'll use the existing "attach" method to
    // accomplish this which will insert the record and any more attributes.
    $instance->save(['touch' => false]);

    $this->attach($instance->getKey(), $joining, $touch);

    return $instance;
}

其中,$instance->getKey()就是獲取主鍵的值。

因此,要實(shí)現(xiàn)通過非主鍵key來關(guān)聯(lián),分兩步走,先手工創(chuàng)建Attachment記錄,然后attach($attachmentKey)。要想一步到位它就是使用主鍵id來關(guān)聯(lián)。

一般來說,一個(gè)表的外鍵使用另一個(gè)表的主鍵是比較主流的做法,Laravel這么做也有一定道理。最終我決定也通過Attachment中的id來關(guān)聯(lián)算了,不使用非主鍵key來關(guān)聯(lián)。

解夏 回答

https://github.com/top-think/...

TP5 的max驗(yàn)證規(guī)則git版本看的是有用mb_strlen來進(jìn)行字符串長度驗(yàn)證。不知道你用的什么版本

小曖昧 回答

個(gè)人推薦保存到日志文件中,日志量大,你每次保存數(shù)據(jù)庫會(huì)增加數(shù)據(jù)庫的寫負(fù)擔(dān),而且放在日志文件中,后期可以做類似Logstash應(yīng)用來做日志采集,進(jìn)行數(shù)據(jù)可視化分析,這個(gè)時(shí)候就不用擔(dān)心多余的數(shù)據(jù)庫讀負(fù)擔(dān),畢竟數(shù)據(jù)庫的讀寫資源是非常重要的。