且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

警告:strlen()期望参数1为字符串,文件中给定的数组...

更新时间:2023-02-18 17:03:37

strlen()文档 :

strlen()在数组上执行时返回NULL,并发出E_WARNING级错误.

strlen() returns NULL when executed on arrays, and an E_WARNING level error is emitted.


如果您有数组,请使用 count() 计算元素:


If you have an array, use count() to count the elements:

if (count($value) > 0)