Human Readable Filesize

The easiest way to automatically convert file sizes in bytes to more human readable in php.

function human_filesize($bytes, $decimals = 2) {
    $sz = 'BKMGTP';
    $factor = floor((strlen($bytes) - 1) / 3);
    return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
}

Amiel Simbahon

Amiel Simbahon
Software Maker

Option Page for your Plugin or Theme

How to add option page to your plugin or theme. Continue reading

Wordpress Ajax Frontend

Published on February 21, 2017

PHP Date Quirks

Published on February 20, 2017