title: Best way to allow plugins for a PHP application
body: <p>I am starting a new web application in PHP and this time around I want to create something that people can extend by using a plugin interface. </p>
  
  <p>How does one go about writing 'hooks' into their code so that plugins can attach to specific events?</p>