Skip to content

Instantly share code, notes, and snippets.

@codfish
Last active August 29, 2015 14:22
Show Gist options
  • Save codfish/e1f5db19f953465bfdd7 to your computer and use it in GitHub Desktop.
Save codfish/e1f5db19f953465bfdd7 to your computer and use it in GitHub Desktop.
Quick and clean way to define a PHP constant if it doesn't already exist.
<?php
! defined('DB_HOST') && define('DB_HOST', '127.0.0.1');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment