在PHP 5.3.5中出现Undefined offset: 0的解决方法
来源:互联网 发布:美丽水世界优化补丁 编辑:程序博客网 时间:2024/04/29 03:44
在使用PHP 5.3.5的时候,出现了如下的情况:
提示未定义的数组偏移量,但是我这个数组,的确是非空的,
因为我通过is_array()进行了判断,结果在使用
if (is_array($cookies)) {$cookieK = array_keys($cookies);$cookieV = array_values($cookies);//print_r($cookieK);//print_r($cookieV);exit;//echo "{$cookieK[0]}, {$cookieV[0]['value']}, {$cookieV[0]['path']}, {$cookieV[0]['domain']}";$this->_client->setCookie($cookieK[0], $cookieV[0]['value'], $cookieV[0]['path'], $cookieV[0]['domain']);}
是提示这里的is_array($cookies)有问题,经过修改,添加一个判断:
就可以了,莫非在5.3.5中,已经对判断更加的严格啦?
- 在PHP 5.3.5中出现Undefined offset: 0的解决方法
- Notice: Undefined offset 的解决方法
- Notice: Undefined offset 的解决方法
- [php]Undefined offset: 0错误
- php Yii: 出现undefined offset 或者 undefined index解决方案
- php中提示Undefined index的解决方法
- php中提示Undefined index的解决方法
- php中提示Undefined index的解决方法
- php中提示Undefined index的解决方法
- php中提示Undefined index的解决方法
- php中提示Undefined index的解决方法
- php中提示Undefined index的解决方法
- php中提示Undefined index的解决方法
- php中提示Undefined index的解决方法
- php出现 Notice: Undefined index: name 的解决方法
- PHP运行出现Notice : Use of undefined constant 的解决方法
- PHP出现Notice警告 : Use of undefined constant的解决方法
- php运行出现Call to undefined function curl_init()的解决方法
- hdu 3884 Hinanai Tenshi’s peach garden
- 模块编译时出现not in prelink map错误
- 各大硬件官方网站
- C# GZipStream 压缩 解压
- Ogre源码分析与学习笔记-1
- 在PHP 5.3.5中出现Undefined offset: 0的解决方法
- brew制作lib
- 转载:A word for WinDbg
- uitableview方法的说明
- Inno Setup教程
- Action的execute()方法
- IP,UDP,TCP,SCTP特性比较
- 用鼠标拖动图片移动
- 使用LoadRunner轻松搭建测试云,开始云测试