Last active
October 7, 2017 13:41
-
-
Save devuri/4bf21264ea4e4fc80f046a4da8c4b6a7 to your computer and use it in GitHub Desktop.
Function Set value if not exist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //input @param $var : empty variable (string); @param $new_var (set new variable) | |
| function empty_var($var,$new_var){ | |
| if ( empty($var) ) $var = $new_var; | |
| return $var; | |
| } | |
| // credits https://gist.github.com/JeffreyWay/3194444 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment