It is well-known that the structure of a Web application coded with event mechanism to process some events such as loading a page,clicking a button and changing the selection of a drop-down box could be clearer,more readable and more reusable than the one coded simply with sequential sentences.So,a solution for implementing PHP event mechanism is brought forth in this paper;meanwhile,some illustrational codes and essential comments are provided.