Overview

Packages

  • Onion::Controllers
  • Onion::Core
  • Onion::UI
  • Onion::Utils

Classes

  • Arrays
  • Assets
  • Filesystem
  • Image
  • Languages
  • Mail
  • Secure
  • Strings
  • SWF
  • Utils
  • Validate
  • Visitor
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: 
 3: /**
 4:  * Onion Framework - Rôzne pomocné funkcie
 5:  *
 6:  * Copyright (c) 2011 Jano Gašpar (http://webstranky.net)
 7:  *
 8:  * @author    Jano Gašpar
 9:  * @copyright Copyright (c) 2011 Jano Gašpar
10:  * @package   Onion::Utils
11:  **/
12: class Utils
13: {
14:     public static function to_bytes($val) {
15:         $val = trim($val);
16:         $last = strtolower($val[strlen($val)-1]);
17: 
18:         switch($last) {
19:             case 'g':
20:                 $val *= 1024;
21: 
22:             case 'm':
23:                 $val *= 1024;
24: 
25:             case 'k':
26:                 $val *= 1024;
27:         }
28: 
29:         return $val;
30:     }
31: }
32: 
Onion API documentation generated by ApiGen.
Generated using the TokenReflection library.