How to Get Domain From URL in PHP

Sometimes, you may need to extract the domain or some other parts from an URL. It is a very straightforward task that can be done using the built-in parse_url() function without any external libraries. However, third-party libraries can provide more convenience and power to handle URLs In this short article, I will show how to … Read more

How to Read XLSX File Into Array

Sometimes you may need to import some data from an XLSX file into your application. The first step is to load data from the file into an array. There are a few libraries that can help with this. Each library has its advantages and disadvantages and may be the best solution in a specific case. … Read more

How to Install Specific Version of Package Using Composer

Composer is a package manager for PHP programming language. You can use it to install or update packages, manage their dependencies, and a lot of other things. By default, Composer installs the latest version of a required package. But you can install any specific version which you want. In this short article, I will show … Read more

How to Calculate Execution Time in PHP

There are a lot of cases when you might need to measure code execution time. For example, you want to speed up your application and you need to find the slowest part or you want to benchmark several approaches to do something. In this article, I will show you multiple ways to measure execution time … Read more