<?php
class FileUpLoad{private $error;//错误代码
public function __construct($_file){
$this->error=$_FILES[$_file][error];
echo $this->error;
}
}
?>
因为error 没有加上单引号 当打印出来的时候会提示
报错:Notice: Use of undefined constant error - assumed 'error' in C:\wamp\www\yianshujuku\common\FileUpload.class.php on line 6,最好加上单引号
即下面所示:
<?php
class FileUpLoad{private $error;//错误代码
public function __construct($_file){
$this->error=$_FILES[$_file][‘error’];
echo $this->error;
}
}
?>