Functions in PHP work as blocks of code designed to perform specific tasks like print messages. Functions execute only when called, which prevents overlapping excuted messages which would crowd the website and confuse users.