RegexIterator
RegexIterator::__construct
RegexIterator
PHP Manual

# RegexIterator::accept

(PHP 5 >= 5.2.0)

RegexIterator::accept — Get accept status

### Opis

public bool RegexIterator::accept ( void )

Matches (string) RegexIterator::current (or RegexIterator::key if the RegexIterator::USE_KEY flag is set) against the regular expression.

### Parametry

Ta funkcja nie posiada parametrów.

### Zwracane wartości

`TRUE` if a match, `FALSE` otherwise.

### Przykłady

Przykład #1 RegexIterator::accept example

This example shows that only items matching the regular expression are accepted.

`<?php
$names = new ArrayIterator(array('Ann', 'Bob', 'Charlie', 'David'));
$filter = new RegexIterator($names, '/^[B-D]/');
foreach ($filter as $name) {
echo $name . PHP_EOL;
}
?>`

Powyższy przykład wyświetli:

    Bob
    Charlie
    David

### Zobacz też:

- RegexIterator constants
- RegexIterator::setFlags - Sets the flags.

RegexIterator
RegexIterator::__construct
RegexIterator
PHP Manual