Created
January 17, 2018 11:39
-
-
Save nhatnx/c3d33af3b99663f46c87be8a20a88c65 to your computer and use it in GitHub Desktop.
PHP array delete by value (not key)
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 | |
| if (($key = array_search($del_val, $messages)) !== false) { | |
| unset($messages[$key]); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment