PHP - Count items in object -
i'm using kirby cms , need find out how many posts have.
my posts gotten with
$posts = $pages->find('posts')->children();
which echos object
10 items (links posts).
it not array using count()
returns 1.
how can count items in object array?
i have no experience library. try this, might work:
$count = $pages->find('posts')->children()->count();
Comments
Post a Comment