downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Interfejsy> <RegexIterator::setMode
[edit] Last updated: Fri, 30 Nov 2012

view this page in

RegexIterator::setPregFlags

(PHP 5 >= 5.2.0)

RegexIterator::setPregFlagsSets the regular expression flags.

Opis

public void RegexIterator::setPregFlags ( int $preg_flags )

Sets the regular expression flags.

Parametry

preg_flags

The regular expression flags. See RegexIterator::__construct() for an overview of available flags.

Zwracane wartości

Nie jest zwracana żadna wartość.

Przykłady

Przykład #1 RegexIterator::setPregFlags() example

Creates a new RegexIterator that filters all entries with where the array key starts with 'test'.

<?php
$test 
= array ('test 1''another test''test 123');

$arrayIterator = new ArrayIterator($test);
$regexIterator = new RegexIterator($arrayIterator'/^test/'RegexIterator::GET_MATCH);

$regexIterator->setPregFlags(PREG_OFFSET_CAPTURE);

foreach (
$regexIterator as $key => $value) {
    
var_dump($value);
}
?>

Powyższy przykład wyświetli coś podobnego do:

array(1) {
  [0]=>
  array(2) {
    [0]=>
    string(4) "test"
    [1]=>
    int(0)
  }
}
array(1) {
  [0]=>
  array(2) {
    [0]=>
    string(4) "test"
    [1]=>
    int(0)
  }
}

Zobacz też:



add a note add a note User Contributed Notes RegexIterator::setPregFlags - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites