Skip to content

Instantly share code, notes, and snippets.

@bryanrsebastian
Last active January 4, 2018 01:44
Show Gist options
  • Save bryanrsebastian/f4a353c5c8c31165f072b6da4e5ce82a to your computer and use it in GitHub Desktop.
Save bryanrsebastian/f4a353c5c8c31165f072b6da4e5ce82a to your computer and use it in GitHub Desktop.
<?php
/**
* Global checker
* @param string/array $var the function will check this variable
* @return boolean true if not empty, not null, is set, and not equal to ''.
*/
if ( ! function_exists( 'checker' ) ) {
function checker( $var ) {
return ( $var && $var != '' && ! empty( $var ) && ! is_null( $var ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment