title: Best way to do PHP hooks
body: <p>I'm wondering what the best way is of handling hooks in a PHP application<br>
  -  so I can insert custom or 'plug in' functionality without modifying the main body of code. </p>
  
  <p>I know Wordpress features something like this.
  Is it really alright to do something as follows:</p>
  
  <pre><code>if (file_exists('file_before'){ include('file_before'); }
  
  print 'hello';
  
  if (file_exists('file_after'){ include('file_after'); }
  </code></pre>