Skip to content

Instantly share code, notes, and snippets.

@jeyemwey
Last active August 29, 2015 14:17
Show Gist options
  • Save jeyemwey/08aaf0d57fbd67c5a798 to your computer and use it in GitHub Desktop.
Save jeyemwey/08aaf0d57fbd67c5a798 to your computer and use it in GitHub Desktop.
This little function returns the first argument if it's set in the main application.
<?php
function p(&$var, $else = '') {
$var = (isset($var) && $var) ? $var : $else;
return $var;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment