wp_convert_hr_to_bytes

Definition:
function wp_convert_hr_to_bytes( $size ) {}

Parameters

  • unknown_type $size

Source code

function wp_convert_hr_to_bytes( $size ) {

	$size = strtolower($size);

	$bytes = (int) $size;

	if ( strpos($size, 'k') !== false )

		$bytes = intval($size) * 1024;

	elseif ( strpos($size, 'm') !== false )

		$bytes = intval($size) * 1024 * 1024;

	elseif ( strpos($size, 'g') !== false )

		$bytes = intval($size) * 1024 * 1024 * 1024;

	return $bytes;

}

3491

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: