简体   繁体   中英

PHP 7.3 Warning count(): Parameter must be an array or an object that implements Countable

I get this message warning even when the array is not empty, I don't understand why because I checking fisrt if it is an array before to do the count

Here is my code:

if(isset($res_remind_att) && is_array($res_remind_att))
{   
    if(count($res_remind_att > 0))
    {...}
}

Your syntax is incorrect. Try writing it like this

if(isset($res_remind_att) && is_array($res_remind_att))
{   
    if(count($res_remind_att) > 0)
    {
    //here your code...
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM