[PHP daily function] cycle 03
2019-02-27
array_keys()
array_keys ( array $array [, mixed $search_value = null [, bool $strict = false ]] ) : arrayDescription: get some or all key names in the array
$arr = [
'name' => 'ZhangSan',
'age' => 18,
'gender' => 'man',
];
print_r(array_keys($arr));
// output
Array
(
[0] => name
[1] => age
[2] ...
Posted by vbmurray on Sun, 08 Dec 2019 01:00:22 -0800
How to improve the quality of PHP code
To be honest, PHP is under a lot of pressure in terms of code quality. By reading this series of articles, you'll learn how to improve the quality of your PHP code.
There are many reasons for this, but it's certainly not just the lack of proper testing tools for the PHP ecosystem. In this article, I want to show you a simple setup for basic qu ...
Posted by Alex-B on Sat, 07 Dec 2019 22:17:16 -0800
LNMP deployment instance and HTTPS service implementation
LNMP deployment instance and HTTPS service implementation
What is LNMP: Linux + nginx + MySQL + (PHP FPM, PHP MySQL)
The web service architecture of Nginx+Mysql+Php on the Linux operating system.
MySQL in CentOS 6, Mariadb in CentOS 7
What's the function: it provides web services and can parse applications of PHP classes;
Next, I will dep ...
Posted by jason102178 on Sat, 07 Dec 2019 21:27:47 -0800
If the php script execution process does not exit within 30 minutes, kill these php script processes
The online script content is as follows:[root@localhost ~]# cat /data/scripts/check_php.sh
#!/bin/bash
Date=`date "+%Y-%m-%d %H:%M:%S"`
Num=$(ps -ef|egrep "countjs_syc_site*|countjs_syc_plan*|countjs_syc.php|countjs_syc_img*|setcache*"|grep -v grep |wc -l)
Pid=$(/bin/ps -ef|egrep "countjs_syc_site*|countjs_syc_plan*|countjs_syc.php|countjs_ ...
Posted by billf2007 on Sat, 07 Dec 2019 18:48:28 -0800
[php implementation data structure] linked queue
What is chain queue
Queue is a "first in, first out" storage structure, which is a special linear table. It only allows deletion at the front of the table, and insertion at the rear of the table.Generally, queues can be implemented in two ways: sequential queues and chained queues,As the name implies, sequential queue adopts sequentia ...
Posted by eevan79 on Sat, 07 Dec 2019 07:48:00 -0800
LSP merchant API
Your domain: lsp-api-merchant.hhs2717.cn
Virtualhost conf: /usr/local/nginx/conf/vhost/lsp-api-merchant.hhs2717.cn.conf
Directory of: /data/wwwroot/lsp-api-merchant.hhs2717.cn
Rewrite rule: /usr/local/nginx/conf/rewrite/laravel.conf
Self-signed SSL Certificate: /usr/local/nginx/conf/ ...
Posted by spoons84 on Sat, 07 Dec 2019 06:12:50 -0800
php causes memory overflow
When performing a step of exporting csv, when more than 3w pieces of data are to be exported, an error will be reported, as follows:
Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)
php stores more than 3w pieces of data. This array takes up more than 20M of memory
Solution: take data in batches and process da ...
Posted by mattsutton on Sat, 07 Dec 2019 00:45:51 -0800
zookeeper dynamically manages nginx configuration
Suppose we have a scenario in which all servers share the same configuration file, we can't maintain each server manually. At this time, we can use the configuration management function of zookeeper.
Environment: python + nginx + zookeeper
Objective: when the configuration file in zookeeper changes, nginx automatically pulls the latest config ...
Posted by tacojohn on Fri, 06 Dec 2019 18:35:38 -0800
Using PHPExcel to parse Excel tables
Install class library
Download PHPExcel class library from GitHub
Address: https://github.com/PHPOffice/PHPExcel
After unzipping, move the Classes folder to the extend directory of ThinkPHP and rename it phpexcel
Add references where needed in the project
import('phpexcel.PHPExcel', EXTEND_PATH);
code implementation
<?php
namespace app\ind ...
Posted by tlawless on Fri, 06 Dec 2019 12:37:45 -0800
Zephir for PHP extension development
If you often pay attention to the PHP framework falcon, you should know that the team of Falcon has developed a high-level language for better development of falcon—— Zephir.
Zephir, an open source high-level language, aims to simplify the creation and maintainability of PHP extensions, focusing on type and memory secu ...
Posted by nvidia on Fri, 06 Dec 2019 12:24:58 -0800