Last active
April 29, 2018 08:50
-
-
Save alexd73/0b2d00e2436bb678dfd5d62fcb159429 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* Убирает из массива элемент по его значению | |
* @param $arr | |
* @param $value | |
*/ | |
function unset_by_value(&$arr, $value){ | |
if (($key = array_search($value, $arr)) !== false) { | |
unset($arr[$key]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment