function counts($array) { if (empty($array)) { return 0; } array_shift($array); return 1 + counts($array);}