代码之家  ›  专栏  ›  技术社区  ›  hd.

如何处理PHP7.2中的Count()警告?

  •  -1
  • hd.  · 技术社区  · 7 年前

    如何解决PHP7.2中的此警告?

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

    1 回复  |  直到 7 年前
        1
  •  0
  •   danyg    7 年前

    if (is_array($variable) && count($variable) > 0) { ... }
    
    推荐文章