关于解决PHP报错“Notice:Use of undefined constant error” 解决办法
2014-11-12 15:43
555 查看
<?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;
}
}
?>
相关文章推荐
- PHP出现Notice警告 : Use of undefined constant的解决方法
- PHP正则替换函数preg_replace()报错:Notice Use of undefined constant的解决方法分析
- PHP运行出现Notice : Use of undefined constant 的解决办法
- PHP运行出现Notice : Use of undefined constant 的解决办法
- php Use of undefined constant的问题解决方式
- 关于Notice: Use of undefined constant username - assumed 'username' in警告问题
- PHP运行出现Notice : Use of undefined constant 的解决办法
- PHP运行出现Notice : Use of undefined constant 的解决办法
- php当中出现的错误:Use of undefined constant title - assumed 'title'的解决方法
- php提示 Notice: Use of undefined constant name - assumed
- PHP运行出现Notice : Use of undefined constant 的解决办法
- PHP Notice: Use of undefined constant variable
- PHP运行出现Notice : Use of undefined constant 的解决办法
- PHP运行出现Notice : Use of undefined constant 的解决办法
- php:Notice: Use of undefined constant id - assumed 'xxxx' 解决办法
- Notice: Trying to get property of non-object problem(PHP)解决办法
- 关于android编程遇到java.lang.OutOfMemoryError: bitmap size exceeds VM budget此类问题的原因及解决办法
- Notice: Trying to get property of non-object problem(PHP)解决办法
- Notice: Use of undefined constant submit - assumed &#39;submit&#39;
- PHP提示Notice: Undefined variable的解决办法