List Info

Thread: note 72755 added to function.ini-get




note 72755 added to function.ini-get
user name
2007-01-31 14:02:53
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')
);
?>
----
Server IP: 216.235.15.211
Probable Submitter: 70.52.191.9
----
Manual Page -- htt
p://www.php.net/manual/en/function.ini-get.php
Edit        -- https://master
.php.net/note/edit/72755
Del: integrated  -- h
ttps://master.php.net/note/delete/72755/integrated
Del: useless     -- http
s://master.php.net/note/delete/72755/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/72755/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/72755/spam
Del: non-english -- 
https://master.php.net/note/delete/72755/non-english
Del: in docs     -- http
s://master.php.net/note/delete/72755/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/72755
Reject      -- https://mast
er.php.net/note/reject/72755
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


note 72755 deleted from function.ini-get by nlopess
user name
2007-01-31 14:07:01
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


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )