I need to document and create a list of variables in my code as part of my A Level computing coursework, however my PHP script is over 6,000 lines in total.

Does anyone know of any software that will display a list of variables within my code? I really don't feel like going through all of my code and hand-picking out about a thousand variables :(

Thanks in advance.