public function delete($target, $keepDuplicates = true)
    {
        // We need a copy of $this->collection, not itself:
        $array = $this->collection;

        foreach ($array as $index => $value) {
            if ($value == $target) {
                unset($array[$index]);

                if ($keepDuplicates === true) {
                    break;
                }
            }
        }

        // Now override original stack with replaced one
        $this->collection = $array;
    }
public function delete($target, $keepDuplicates = true)
    {
        // We need a copy of $this->collection, not itself:
        $array = $this->collection;

        foreach ($array as $index => $value) {
            if ($value == $target) {
                unset($array[$index]);

                if ($keepDuplicates === true) {
                    break;
                }
            }
        }

        // Now override original stack with replaced one
        $this->collection = $array;
    }
public function delete ( $ target , $ keepDuplicates = true ) { // We need a copy of $this->collection, not itself:
 $ array = $ this -> collection ; foreach ( $ array as $ index => $ value ) { if ( $ value == $ target ) { unset ( $ array [ $ index ] ) ; if ( $ keepDuplicates === true ) { break ; } } } // Now override original stack with replaced one
 $ this -> collection = $ array ; }
Deletes a value from the stack

@param string $target
@param boolean $keepDuplicates Whether to keep duplicate values
@return void
Deletes a value from the stack