note 87501 deleted from ref.array by levim
| From: | levim@php.net | Date: | Tue, 06 May 2014 22:07:29 +0000 |
| Subject: | note 87501 deleted from ref.array by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199462@lists.php.net to get a copy of this message | ||
Note Submitter: jan at hooda dot de
----
Two simple functions to add and delete values from arrays:
<?php
function array_add (&$array, $val) {
array_push ($array, $val);
}
function array_del (&$array, $str)
{
if (in_array($str,$array)==true) {
foreach ($array as $key=>$value) {
if ($value==$str) unset($array[$key]);
}
}
}
?>