I noticed in a lot of scripts ( like phpbb ) that some functions are declared on the top of the script just to be used once. What the point of doing that? Are they used to make the code more readable? 

For example I have a page that execute the user login, and the login is an action that can be done just there. So I declare a function for the login and I use it there.