Jquery中文网 www.jquerycn.cn
Jquery中文网 >  脚本编程  >  php  >  正文 php is_array数组 Notice: Array to string conversion

php is_array数组 Notice: Array to string conversion

发布时间:2018-09-28   编辑:www.jquerycn.cn
jquery中文网为您提供php is,array数组 Notice: Array to string conversion等资源,欢迎您收藏本站,我们将为您提供最新的php is,array数组 Notice: Array to string conversion资源
今天在使用一个正则提取字符串中指定字符串内容时我在使用一个is_array()时出现Array to string conversion错误提示了,下面把这个给大家分享一下吧。

例子

$str = preg_match_all('/(<UL class=\"list\">).*?(<\/UL>)/is', $str,$array);

if(is_array($$arrayList[0]) )
{
}

结果发现

Notice: Array to string conversion in E:\get_data.php on line 45

Notice: Undefined variable: Array in E:\get_data.php on line 45

仔细检查一下发现

is_array($$arrayList[0]多了一个美元了,如果说是RMB就好了

我们修改一下

if(is_array($arrayList[0]) )
{
}

执行就没有问题了哦。

您可能感兴趣的文章:
php is_array数组 Notice: Array to string conversion
PHP与Python进行数据交互
is_array -- 检测变量是否是数组
PHP中二维数组的排序方法
php数组编码的转换方式的例子
PHP源码—implode函数源码分析
关于php函数isset和empty的一些误解
php对象转换成数组的实例(兼容多维数组)
php iconv() 编码转换出错 Detected an illegal character
PHP 数组字符集编码转换的函数

[关闭]