当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_get_real_size函数代码示例

本文整理汇总了PHP中PMA_get_real_size函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_get_real_size函数的具体用法?PHP PMA_get_real_size怎么用?PHP PMA_get_real_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_get_real_size函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkUploadSize

 /**
  * Maximum upload size as limited by PHP
  * Used with permission from Moodle (http://moodle.org) by Martin Dougiamas
  *
  * this section generates $max_upload_size in bytes
  */
 function checkUploadSize()
 {
     if (!($filesize = ini_get('upload_max_filesize'))) {
         $filesize = "5M";
     }
     if ($postsize = ini_get('post_max_size')) {
         $this->set('max_upload_size', min(PMA_get_real_size($filesize), PMA_get_real_size($postsize)));
     } else {
         $this->set('max_upload_size', PMA_get_real_size($filesize));
     }
 }
开发者ID:ducthang128,项目名称:VPS_v2,代码行数:17,代码来源:Config.class.php

示例2: testGigabyte

 public function testGigabyte()
 {
     $this->assertEquals(12 * 1024 * 1024 * 1024, PMA_get_real_size('12gb'));
 }
开发者ID:Kishaaa,项目名称:cs160-website,代码行数:4,代码来源:PMA_get_real_size_test.php

示例3: foreach

    //1024 * 1024 * 1024;
    $scan['mb'] = 1048576;
    $scan['m'] = 1048576;
    $scan['kb'] = 1024;
    $scan['k'] = 1024;
    $scan['b'] = 1;
    foreach ($scan as $unit => $factor) {
        if (strlen($size) > strlen($unit) && strtolower(substr($size, strlen($size) - strlen($unit))) == $unit) {
            return substr($size, 0, strlen($size) - strlen($unit)) * $factor;
        }
    }
    return $size;
}
// end function PMA_get_real_size()
$upload_max_filesize = PMA_get_real_size(ini_get('upload_max_filesize'));
$post_max_size = PMA_get_real_size(ini_get('post_max_size'));
$min_upload_size = $upload_max_filesize > $post_max_size ? $post_max_size : $upload_max_filesize;
$max_upload_filesize = $min_upload_size / 1024 / 1024 . ' MB';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/swfupload.swfobject.js"></script>
<script type="text/javascript" src="js/swfupload.queue.js"></script>
<script type="text/javascript" src="js/fileprogress.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript">
开发者ID:hardy419,项目名称:2015-7-27,代码行数:31,代码来源:index.php

示例4: testUnspecified

 public function testUnspecified()
 {
     $this->assertEquals(1024, PMA_get_real_size('1024'));
 }
开发者ID:bugyak,项目名称:phporadmin,代码行数:4,代码来源:PMA_get_real_size_test.php


注:本文中的PMA_get_real_size函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。