Ti suggerisco di iniziare leggendo il manuale ufficiale:

http://www.php.net/get_defined_functions
http://www.php.net/count