Skip to content

Instantly share code, notes, and snippets.

@strattondev
Created October 16, 2013 18:09
Show Gist options
  • Save strattondev/7012207 to your computer and use it in GitHub Desktop.
Save strattondev/7012207 to your computer and use it in GitHub Desktop.
PH Multi Define function
/**
* Defines mutiple objects
*
* @param mixed $key Key to define or Array of keys to define
* @param mixed $value Value to corespond with single key or FALSE
* @return bool
*/
function multiDefine($key, $value = FALSE) {
if (is_null($key)) return FALSE;
if (is_array($key))
foreach ($key as $k => $v)
if (!defined($k)) define($k, $v);
else
if (!defined($key)) define($key, $value)
return TRUE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment