Ignore:
Timestamp:
09/28/06 10:59:14 (13 years ago)
Author:
ray
Message:
  • php-xinha.php: I assume that this is the right place for general utility functions?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/contrib/php-xinha.php

    r578 r593  
    183183    } 
    184184  }        
    185     
     185 
     186  /** Return upload_max_filesize value from php.ini in kilobytes (function adapted from php.net)**/ 
     187  function upload_max_filesize_kb()  
     188  { 
     189    $val = ini_get('upload_max_filesize'); 
     190    $val = trim($val); 
     191    $last = strtolower($val{strlen($val)-1}); 
     192    switch($last)  
     193    { 
     194      // The 'G' modifier is available since PHP 5.1.0 
     195      case 'g': 
     196        $val *= 1024; 
     197      case 'm': 
     198        $val *= 1024; 
     199   } 
     200   return $val; 
     201} 
    186202?> 
Note: See TracChangeset for help on using the changeset viewer.