Skip to content

Instantly share code, notes, and snippets.

@ludo237
Created February 2, 2016 08:19
Show Gist options
  • Save ludo237/76353fc523f3be520492 to your computer and use it in GitHub Desktop.
Save ludo237/76353fc523f3be520492 to your computer and use it in GitHub Desktop.
Array Push Hack
<?php\
/**
* array_push_assoc is a moch-up of the standard core.php Array Push
* @param array $array
* @param object $key
* @param object $value
* @return array $array
*/
public function array_push_assoc(&$array, $key, $value){
// Simply insert the key and the value into the array
$array[$key] = $value;
return $array; // return it
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment