Convert and format Bytes PHP function

A simple PHP function to convert and format Bytes to Megabytes, Gigabytes and Terabytes: function convertBytes(int $bytes, string $convert_to = ‘KB’, bool $format = true, int $decimals = 2): float…

Using PHP __DIR__

PHP __DIR__  returns the current working directory, its usage is common when including files as you don’t have to dynamically define the directory each time. Simply running echo __DIR__; Will…