Skip to content

Instantly share code, notes, and snippets.

<?php
class Collection implements ArrayAccess, Iterator, Countable
{
private $_data = array();
private $_strict;
protected $_pointer = 0;
const SEPARATOR = ':';
<?php
function array_delete(array &$array, $elements) {
//jeśli parametr $elements jest tablicą kluczy do usunięcia
if (is_array($elements)) {
//ile elementów do usunięcia
$toDelete = count($elements);
//ile usunięto poprawnie
$deleted = 0;
foreach ($elements as $index) {
if (unset($array[$index])) $deleted++;