鍍金池/ 問答/ PHP問答
孤巷 回答

打破翻譯成避免就比較容易懂了

別硬撐 回答

一個HTTP請求中不允許一次下載多個文件,如果你有多個文件需要下載,可以打包成一個zip。

也可以用JavaScript去創(chuàng)造多個<a>標(biāo)簽,模擬<a>標(biāo)簽的點(diǎn)擊操作,這樣其實(shí)是發(fā)出了3個HTTP請求:

function downloadAll(urls) {
    var link = document.createElement('a');

    link.setAttribute('download', null);
    link.style.display = 'none';

    document.body.appendChild(link);

    for (var i = 0; i < urls.length; i++) {
        link.setAttribute('href', urls[i]);
        link.click();
    }

    document.body.removeChild(link);
};

downloadAll(<?php echo json_encode($urls) ?>);
北城荒 回答

不推薦存數(shù)據(jù)庫中,假如站點(diǎn)訪問量大的時(shí)候,對數(shù)據(jù)庫會頻繁寫入,頻繁讀取,從而影響數(shù)據(jù)庫性能。一般用redis memcache存更好些。而且維護(hù)過期時(shí)間等也方便。設(shè)置key過期時(shí)間就好。

舊城人 回答

這個需要在程序中使用路由進(jìn)行映射處理。這個一般的MVC框架都支持
比如下面這個組合

[
    '/登陸'=>'user/signup',
    '文章/:id'=>'article/show'
]
  • 當(dāng)訪問http://xxx.com/登陸時(shí),系統(tǒng)將執(zhí)行user控制器的signup方法
  • 當(dāng)訪問http://xxx.com/文章/10(10為文章ID)時(shí),系統(tǒng)將執(zhí)行article控制器的show方法,同時(shí)將10作為參數(shù)傳入
墨沫 回答

這個 set_ack_handler 對應(yīng)的 confirm 模式是 producer 和 rabbitmq 之間的的 confirm,不是指 producer 和 consumer

通過 $channel->confirm_select();$channel->wait_for_pending_acks(); 指定,具體可以搜搜對應(yīng)的文檔,例如 這篇 https://www.zybuluo.com/dume2...

風(fēng)畔 回答

插件問題,和sdk沒關(guān)系,sdk一般只提供服務(wù)端的東西。

枕頭人 回答

1.首先你要確定你已經(jīng) brew update 了。
2.其次你可以在命令行運(yùn)行 brew install php71-igbinary --build-from-source
3.可以在 --build-from-source 后面追加 --HEAD 或者 --devel
4.可能是你的Homebrew 版本過低,嘗試重裝:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果仍然不行的話,可以@我

浪婳 回答
  1. 描述不清楚 揣測回答

select * from table where 條件 orderby id DESC 點(diǎn)擊量 DESC limit 50
循環(huán)的時(shí)候 拿第一條不就行了?

假如不想打亂時(shí)間順序。
去掉點(diǎn)擊量排序,
關(guān)注下mysql的max()的用法

  1. 別的解決思路:

你可以先按照時(shí)間順序 加點(diǎn)擊量順序 取出 50條數(shù)據(jù) 。取第一條點(diǎn)擊數(shù)最大的
然后根據(jù)php函數(shù)按時(shí)間重排序

array_multisort()
祉小皓 回答

下載官方案例 查看就行了 官方PHP SDK
下載之后查看里面的案例就行了

或者你看我根據(jù)官方 SDK 打 packagist 包 masterton/alipay-sdk-php

殘淚 回答

去掉后面整個orWher,只考慮一個條件的情況下(紅框內(nèi)有兩個),把pub_time那個條件當(dāng)作a,閉包內(nèi)的short_time當(dāng)作c,相當(dāng)于a ||(a&c),最后的結(jié)果取決與a,a為true(查詢的到的話),結(jié)果為ture,false則結(jié)果為false,所以等價(jià)于a||(a&c) = a

柒槿年 回答

有可能是ssh的事情,設(shè)置一個key

萌小萌 回答

php 版本問題 5.4 以上才支持短數(shù)組寫法

php 5.4

壞脾滊 回答

如果是前端生成:

var html += '<div class="form-group well" id="23"> +
            '<div class="row">' +
            // ...
            '</div>';
            
document.getElementById('id').innerHTML = html;
如果覺得拼字符串麻煩,不妨嘗試下模板引擎,或者試試vue、react啥的。

如果是后端返回的html片段:

$('#id').load('/api/xxx');
陌顏 回答

那你換成Fillder吧。

赱丅呿 回答

Nginx 服務(wù)器無法直接與 FastCGI 服務(wù)器(也就是php-fpm)進(jìn)行通信,本身不能識別php,需要啟用 ngx_http_fastcgi_module 模塊進(jìn)行代理配置,才能將請求發(fā)送給 FastCGI 服務(wù)。

fastcgi_pass 用于設(shè)置 FastCGI 服務(wù)器的 IP 地址(TCT 套接字)或 UNIX 套接字。 fastcgi_param 設(shè)置傳入 FastCGI 服務(wù)器的參數(shù)。

先linux下查看php-fpm開啟了沒有

ps aux | grep php-fpm

然后nginx 加入下面配置。

 location ~ \.php$ {
     fastcgi_pass   127.0.0.1:9000;
     fastcgi_index  index.php;
     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
     include        fastcgi_params;
 }
悶油瓶 回答
$arr = [
  [
    "id" => 7,
    "parent_id" => 9,
    "child_id" => 11,
    "children" => [
      [
        "id" => 4,
        "parent_id" => 11,
        "child_id" => 2
      ],
      [
        "id" => 5,
        "parent_id" => 11,
        "child_id" => 3]
      ,
      [
        "id" => 6,
        "parent_id" => 11,
        "child_id" => 4
      ]
    ]
  ],
  [
    "id" => 8,
    "parent_id" => 10,
    "child_id" => 11,
    "children" => [
      [
        "id" => 4,
        "parent_id" => 11,
        "child_id" => 2
      ], [
        "id" => 5,
        "parent_id" => 11,
        "child_id" => 3
      ], [
        "id" => 6,
        "parent_id" => 11,
        "child_id" => 4
      ]
    ]
  ]
];

$result = array_map(function ($item) {
  return array_merge([$item['parent_id'], $item['child_id']], array_map(function ($item) {
    return $item['child_id'];
  }, $item['children']));
}, $arr);

print_r($result);
離殤 回答

Sometimes people here are not as they could be...

For whatever reason, your php.ini is mis-configured.

One thing to note that all those missing files are actually Windows files (.dll) on Linux these would likely be .so files. I'm assuming your hosting on a Linux server.

First find your php.ini file. If you have command line access via SSH, you can try running:

php --ini
if not you make a simple script, call it test.php like so:

<?php
phpinfo();
?>
Upload the file and run it, something like:

http://www.yoursite.com/test.php

Among the information provided will be the path to php.ini

Once you find it, one option is to edit it and comment out all those extensions, by putting a ";" in front of the line.

Another option is to check if the *.so files exist. Look for them under /usr/lib/php. If they exist, edit your php.ini file to have all those extension end in .so instead of .dll

Finally, if they don't exist, you could install them by using apt-get or yum. An example:

sudo apt-get install php-mbstring

愛是癌 回答

https://mp.weixin.qq.com/debu...

recorderManager.start(options) ,那個只是個回調(diào)函數(shù)吧,當(dāng)錄音開始的時(shí)候就會調(diào)用那個函數(shù)。