check_upload_size()判断是否超过上传文件最大限制

目录

描述

Determine if uploaded file exceeds space quota.

check_upload_size() 描述

用法

<?php check_upload_size$file ); ?>

check_upload_size() 用法

参数

$file

(array) (必填) $_FILES array for a given file.

默认值: None

check_upload_size() 参数

示例

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */

<?php

$file = check_upload_size( $file );

if ( $file['error'] != '0' ) {
     // The file was too large or has another error.
     echo( $file['error'] );
} else {
     // No errors, we can do stuff with $file here.
}

?>

check_upload_size() 示例

注意

  • If there is an error and $_POST['html-upload'] is not set, this function will call wp_die() to display the error message and a back button.

check_upload_size() 注意

历史

check_upload_size() 历史