Automator_System_Report::automator_string_to_num( string $size )
Notation to numbers.
Contents
Description Description
This function transforms the php.ini notation for numbers (like ‘2M’) to an integer.
Parameters Parameters
- $size
-
(Required) Size value.
Return Return
(int)
Source Source
File: src/core/lib/utilities/class-automator-system-report.php
public function automator_string_to_num( $size ) { $l = substr( $size, - 1 ); $ret = (int) substr( $size, 0, - 1 ); switch ( strtoupper( $l ) ) { case 'P': $ret *= 1024; case 'T': $ret *= 1024; case 'G': $ret *= 1024; case 'M': $ret *= 1024; case 'K': $ret *= 1024; } return $ret; }
Expand full source code Collapse full source code View on Github