For concurrency control, you can use Memcacheq, redirs Channle, and so on to handle
Here, I'm just going to talk about how Redis controls concurrency.
Redis control concurrency mainly uses the lpush llen lpop Three functions in the Redis list
Trait is a new feature in PHP5.4 and is a solution for PHP multiple inheritance. For example, it would be cumbersome to inherit two Abstract classes at the same time, and Trait was born to solve the problem.
How to use
First of all, of course
wampserver2.5-apache-2.4.9-mysql-5.6.17-php5.5.12-32b build PHP environment
Under Win, download Wampserver2.5-apache-2.4.9-mysql-5.6.17-php5.5.12-32b.exe, install by default.
Then open the httpd.conf configuration file for Apache under the
Author: White Wolf Source: http://www.manks.top/article/yii2_gii_custom_template This article copyright belongs to the author, welcome reprint, but without the author's consent must retain this paragraph statement, and in the article page obvious
Recently there is a requirement to batch update a few fields in a database table, and in doing so, PDO is used to do parameter binding, in which a pit is encountered.
Solution Selection
The author has known to do batch update has the following
Data-id= "1190000005056078" data-license= "sa" >
Using functions
pcntl_fork();//创建子进程posix_setsid();//设置当前进程为进程组长posix_getpid();//获取进程id
Example
Workerman process
/** * Run as deamon mode. * * @throws Exception */protected static function daemonize()
The example in this paper describes the simple implementation of PHP to generate a TXT file to the specified directory method. Share to everyone for your reference, as follows:
Easy way and very useful
File_put_contents ("C:/zll.txt", "content")
Alternative PHP Cache Chinese full name is "optional PHP caching", is a component of pecl, can be used to cache and optimize the PHP code on the Web server, improve server performance. Can be installed separately from the PECL and can be checked by
First Nginx Tomcat installation decompression. There is a lot of information on the web.
This is mainly the use of nginx implementation of multiple Tomcat proxy configuration. First, the Nginx configuration file is conf/ngins.conf;
Description
Author: White Wolf Source: http://www.manks.top/php_tree_deep.html This article copyright belongs to the author, welcome reprint, but without the author consent must retain this paragraph statement, and in the article page obvious location gives the
when we putWeb
the data on the page leads toExcel
form, sometimes our data needs to be presented in a specific format, and we need to giveCell
Add some style specification information.
first, let's look at how Excel derives from Web pages. When we
Two days ago on the B station saw a small guy paper 100 yuan assembled a computer to play lol picture quality smooth, whim 100 lines of code can (simple) realize what fun. I mainly do PHP development, so I have this article.
Of course, because PHP (
Server address: 192.168.1.231
Domain Name: test1.com directory:/www/test1.com
Domain Name: test2.com directory:/www/test2.com
This configuration idea
Put 2 sites test1.com, test2.com into the directory that Nginx can access/www/Create an Nginx
atitit php serialization
PHP
the serialize
Serialization of
and the
JSON serialization
PHP identifies different types of data with different letters, using serialized PHPwith Yahoo! Web for development website the Services article gives all
Author: White Wolf Source: http://www.manks.top/yii2_xml_response.html.html This article copyright belongs to the author, welcome reprint, but without the author consent must retain this paragraph statement, and in the article page obvious location
These days try to use the Nginx server to see the purpose of the server. found that the server can be used to implement the reverse proxy and load balancing functions, by looking for data to achieve the function of caching Web pages, the following
Array_count_values
Calculates the number of occurrences of all values in a one-dimensional array
$arrayarray(1"hello"1"world""hello");print_r(array_count_values($array));
Output:
Array( [12 2 1)
'). addclass (' pre-numbering '). Hide (
Background: No PHP framework is used
Due to the temporary requirements, Ajax calls the method in PHP, simply write a php file, the file defines two methods, how to use Ajax to call the same PHP file different methods.
The following is the abc.php
1, if the method of the class can be defined as static, as far as possible to define as static, it will increase the speed of nearly 4 times times.
2. The speed of $row [' ID '] is 7 times times that of $row[id].
3. Echo is faster than print, and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service