This file contains 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 | |
class Collection implements ArrayAccess, Iterator, Countable | |
{ | |
private $_data = array(); | |
private $_strict; | |
protected $_pointer = 0; | |
const SEPARATOR = ':'; | |
This file contains 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 | |
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++; |
NewerOlder