我有这样的json响应:

如何获取“成员”的数量,我尝试了一下:
<tbody>
    @foreach ($datas as $post)
    <tr
        <td scope="row">{{ sizeof($post ->json-> members) }}</td>d>
    </tr>
   @endforeach
</tbody>但是我得到了这个错误:
ErrorException
sizeof(): Parameter must be an array or an object that implements Countable (View: C:\xampp\htdocs\firstapp\resources\views\s1.blade.php)有什么需要帮忙的吗?
发布于 2021-11-29 10:29:14
count(json_decode($post[0]->json->members, true));是我的错。对不起;这里的解决方案count(json_decode(json_encode($post->json->members),是真的));
https://stackoverflow.com/questions/70152968
复制相似问题