public function list_count() { // retrieve the list array $list = $this->rebuild_list(); // return 0 if this variable has no value if ($list == '') { return '0'; } $count = count($list); return "{$count}"; // make sure we return a string }