Created
February 2, 2016 08:19
-
-
Save ludo237/76353fc523f3be520492 to your computer and use it in GitHub Desktop.
Array Push Hack
This file contains 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\ | |
/** | |
* 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