Invoke call_user_func_array error: expected to be a reference, value given

IssueUse the call_user_func_array method to call a callback, and pass parameters by reference. The c...
Feb 16, 2021 PHP Comments 0

Get file name without file extension in PHP

This article introduces two ways to get file name without file extension in PHP.1. Using regular exp...
Dec 29, 2020 PHP Comments 0

Get text between <tag> and </tag> with PREG in PHP

When we make a simple web crawler in PHP, we often need to extract HTML tags. We can use some third ...
Sep 01, 2020 PHP Comments 0

PHP 7.4 configure: error: The pkg-config script could not be found or is too old

IssueIn Linux and Mac Os, I compile the source code of PHP 7.4.9. Run the following commands.$ ./con...
Aug 24, 2020 PHP Comments 0

PHP 5 Configure error in Mac: Undefined symbols for architecture x86_64: "_libiconv", referenced

IssueIn Mac OS, I compile the source code of PHP 5, include 5.4.45/5.5.38/5.6.40. Run the following ...
Aug 08, 2020 PHP Comments 0

Handle large file downloads in PHP

In order to handle file download, we need to response several HTTP headers and write a file to the o...
Aug 06, 2020 PHP Comments 0

Support download with resume in PHP

RequirementIn web application, we often need to provide file downloads. For small files, there is no...
Aug 04, 2020 PHP Comments 0

Insert string at specified position with PHP

Use PHP's substr_replace() method to insert a string into an existing string.  Refer to substr_repla...
Jul 15, 2020 PHP Comments 0

Generator random string with PHP

Two ways to generate random strings using PHP.1. With rand methodfunction generateRandomString($leng...
Jul 13, 2020 PHP Comments 0

Include OpenSSL support of php 5 in Mac OS

IssueUsing the openssl_encrypt() method in Mac OS, something went wrong.Call to undefined function o...
Jul 07, 2020 PHP Comments 0