Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * isset( $var['a'], $var['b'] ) shortcut: array_has( $var, 'a', 'b' );
- */
- function array_has( &$var ) {
- $args = func_get_args();
- if ( ! empty( $args ) && is_array( $args[0] ) && count( $args ) > 1 ){
- $count_args = count( $args );
- for ( $i = 1; $i < $count_args; $i++ ) {
- if ( ! isset( $var[$args[$i]] ) ) {
- return false;
- }
- }
- return true;
- }
- return false;
- }
- ?>
Add Comment
Please, Sign In to add comment