PHP版本问题

来源:互联网 发布:反淘宝联盟yy是多少 编辑:程序博客网 时间:2024/05/17 19:15
如:以下这个也会提示错误,自己配置的都正常!  <?php function chinesesubstr($str,$start,$len){  $strlen=$start+$len;  for($i=0;$i<$strlen;$i++){   if(ord(substr($str,$i,1)>0xa0)){    $tmpstr.=substr($str,$i,2); $i++;   }    else     $tmpstr.=substr($str,$i,1);  }  return $tmpstr; }?>错误提示:Notice: Undefined variable: tmpstr in D:\Program Files\EasyPHP5.3.0\www\php-operate-mysql-database\check_luan_affiche.php on line 10第十行是:     $tmpstr.=substr($str,$i,1);
1。php 5.30版本中变量在使用前未定义默认会有提示。2。解决方案: 方案一:修改php.ini配置文件error_reporting = E_ALL & ~E_NOTICE 方案二:在php文件最前面在上下面代码(只对该文件起作用) error_reporting(E_ALL & ~E_NOTICE);

原创粉丝点击