get lenth of an array php 7 code example Example: how to get length of object in php $total = count((array)$obj);