Where to place php code snippets in Drupal? Whereabouts are you meant to place a snippet of php code? I am guessing the root of site? Don't you need to have something point to it?

I am wanting to place this snippet I found to encode email http://shamsphp.blogspot.com.au/2012/11/how-to-encode-email-address.html
You should place this helper function in your custom module, so once the module get enabled the you can call this function anywhere across drupal environment.