How to delete a element in an array
This problem sounds where simple, but it did take me a lot of effort to figure out that PHP doesn’t have any really good functionallity for it. So did create my own version.
<?php function in_array_delete($array, $item) { if (isset($array[$item])) { unset($array[$item]); } return array_merge($array); } ?> |