Note Submitter: Jeff at wecreate dot com
Reason: in docs
----
To convert an convert ini size such as upload_max_filesize
to bytes:
<?
function toBytes($matches) {
switch(strtolower($matches[2])) {
case "k" : return $matches[1] * 1024; break;
case "m" : return $matches[1] * 1048576; break;
case "g" : return $matches[1] * 1073741824;
break;
}
}
$maxBytes = preg_replace_callback(
'/([0-9]+)([gmk])/i',
'toBytes',
ini_get('upload_max_filesize')
);
?>
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|