好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php is_array数组 Notice: Array to string conversion

今天在使用一个正则提取字符串中指定字符串内容时我在使用一个is_array()时出现Array to string conversion错误提示了,下面把这个给大家分享一下吧.

PHP实例代码如下:

$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]) )  { //开源软件:phpfensi测试数据   } 

执行就没有问题了.

 

查看更多关于php is_array数组 Notice: Array to string conversion的详细内容...

  阅读:36次