php扩展
Tips
array_column函数
array_column()
:第二个参数为null,指定第二维数组里的键为第三个参数,可以提取该键对应的值为一维的键值
$arr = [ ['id'=>'a','name'=>'A'], ['id'=>'b','name'=>'B'], ['id'=>'c','name'=>'C'] ]; $res = array_column($arr,null,'id');
|
php和java的哈希macSha256加密
Mac mac = Mac.getInstance("HmacSHA256"); SecretKeySpec signingKey = new SecretKeySpec(appSecret.getBytes(), "HmacSHA256"); mac.init(signingKey); byte[] signData = mac.doFinal(encodedStr.getBytes()); byte[] resultBytes = Base64.getEncoder().encode(signData); signatureResult = new String(resultBytes, "UTF-8");
|
base64_encode(hash_hmac('sha256', $str, $this->appSecret, true))
|
查看php.ini的文件位置
![WeChat111b3a8227c5190eda96fe19820a9d8c.png](https://alon-image-130
5333140.cos.ap-shanghai.myqcloud.com/blog/WeChat111b3a8227c5190eda96fe19820a9d8c.png)
composer
切换源
composer config -g repo.packagist composer https://mirrors.cloud.tencent.com/composer
|
composer config -g repo.packagist composer https://repo.packagist.org
|
composer config -g -l |grep "repositories.packagist.org.url"
|
xdebug
php.ini中xdebug的配置
[xdebug] zend_extension="xdebug.so" xdebug.mode = debug xdebug.client_host = 127.0.0.1 xdebug.client_port = 9003 xdebug.start_with_request=yes xdebug.idekey = xdebug xdebug.discover_client_host=false xdebug.log_level=0
|