note 30897 added to features.file-upload.errors

From: Date: Wed, 02 Apr 2003 14:46:20 +0000
Subject: note 30897 added to features.file-upload.errors
Groups: php.notes 
Request: Send a blank email to php-notes+get-46128@lists.php.net to get a copy of this message
Rather than using a switch, or if/else block, you could use an array. $upload errors = array('File successfully uploaded', 'Uploaded file exceeds the allowed size', 'Uploaded file exceeds the allowed size','File was only partially uploaded, please try again', 'No file was received. Upload again.'); echo $upload_errors[$_FILES[$field_name]['error']]; -- http://www.php.net/manual/en/features.file-upload.errors.php http://master.php.net/manage/user-notes.php?action=edit+30897 http://master.php.net/manage/user-notes.php?action=delete+30897 http://master.php.net/manage/user-notes.php?action=reject+30897

« previous php.notes (#46128) next »