Optimizing Execution Time
- avoid printf() when echo is all you need
- avoid recomputing values inside a loop
- include only files that you need; split the functions into more files if they are not always used together
- if using a database, use persistent connections
- don't use a regular expression when a simple string-manipulation function will do the job; for example, to turn one character into another in a string, use str_replace(), not preg_replace().