Skip to content

Instantly share code, notes, and snippets.

@viccherubini
Created August 5, 2010 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viccherubini/509853 to your computer and use it in GitHub Desktop.
Save viccherubini/509853 to your computer and use it in GitHub Desktop.
<?php
function array_value($key, $search, $default=NULL, $callback=NULL) {
$value = $default;
if ( array_key_exists($key, $search) ) {
$value = $search[$key];
$value = ( function_exists($callback) ? $callback($value) : $value);
}
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment