comment obtenir la longueur d'objet en php

$total = count((array)$obj);
Black Badger