Search Posts

Category: PHP

Nginx and Apache comparison and advantages and disadvantages

Today is a more detailed comparison of the similarities and differences, advantages and disadvantages of apache httpd and nginx web servers. Since I am not doing web development, so please understand that there are any misunderstandings. I want to understand them because I sometimes use it in my work. I have used nginx+apache in my system. The vast majority of the information in this article is excerpted from the Internet. All that you do is […]

php download mp3 source code

sample code


【PhpMyAdmin】 Why do I get an error on the login screen after setting the password?

We will show you the solution if you get an error when you open phpMyAdmin’s login screen after setting up a password using XAMPP. 1 cause of the error 2 error resolution instructions Cause of error The following error message may be displayed when opening the login screen after setting the root user password with phpMyAdmin “Privileged” menu or XAMPP shell etc. # 1045 – Access denied for user ‘root’ @ ’localhost’ (using password: NO) […]

Send Japanese mail so as not to be garbled: mb_send_mail function

Avoid fatal errors such as garbled characters When implementing a system that sends emails on a website or system, specifying Japanese text as the title or body as it is may result in garbled characters. This time, I will explain how to solve the following problems. Japanese mail is garbled. I do not know how to specify the character code. Naturally, if you get garbled, you can not read your email at all. Furthermore, if […]

Php get random string

Method one: shuffle function (scrambling array) and mt_rand function (generating random numbers, four times faster than rand)

  Method two, str_shuffle function (scramble string order) and mt_rand function

  Method three, md5 (), uniqid (), microtime () generate a unique 32-bit string

  Other way


File_get_contents increases the time limit for timeouts

When using the file_get_contents function, there will often be a timeout situation. Here you should check the error prompt to see what kind of error, the more common is the read timeout. In this case, you can try to avoid it by some means. Or solve it. Here are two simple introductions: First, increase the time limit of timeout Note here that set_time_limit simply sets the timeout for your PHP program, not the timeout for […]

use multiple PHP version at a same time with a single xampp installation

Why switch between PHP versions when you can use multiple PHP version at a same time with a single xampp installation? With a single xampp installation, you have 2 options: Run an older PHP version for only the directory of your old project: This will serve the purpose most of the time, you may have one or two old projects that you intend to run with older PHP version. Just configure xampp to run older […]

Next Page »