PLAIN TEXTPHP: getFiles(‘userfile‘);// return a file object or errorif (PEAR::isError($file)) { die ($file->getMessage());}// Check if the file is a valid uploadif ($file->isValid()) { // this method will return the name of the file you moved, // useful for example to save the name in a database $file_name = $file->moveTo(‘./uploads_dir/‘); if (PEAR::isError($file_name)) { die ($file_name->getMessage()); }}?>多文件上传的例子
PLAIN TEXTCODE: Image 1: Image 2: Image 3: PLAIN TEXTPHP: getFiles(); // returns an array of file objects or errorforeach ($files as $file) { if ($file->isValid()) { ... }}?>