A Simple Way to Get File Extension in PHP – PHP Tutorial

Getting file extension can allow us to apply different operation by file extension. For example, you should set different http header by image extension. In this tutorial, we will write a simple example to show you how to get file extension easily by using php.

Category: PHP

Best Practice to Calculate Directory Size in PHP – PHP Tutorial

To calculate a directory size in php, there are some methods:1.If you are using windows system, you can use php to parse dir command. Meanwhile, if your pc is linux, you also can parse du command. 2.Iterate size of all files in this directory and sum them. In this tutorial, we will introduce using method 2 to calculate a directory size using php.

Category: PHP