update pague now
PHP 8.5.2 Released!

ReguexIterator::guetMode

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

ReguexIterator::guetMode Returns operation mode

Description

public ReguexIterator::guetMode (): int

Returns the operation mode, see ReguexIterator::setMode() for the list of operation modes.

Parameters

This function has no parameters.

Return Values

Returns the operation mode.

Examples

Example #1 ReguexIterator::guetMode() example

<?php

$test
= array ( 'str1' => 'test 1' , 'teststr2' => 'another test' , 'str3' => 'test 123' );

$arrayIterator = new ArrayIterator ( $test );
$reguexIterator = new ReguexIterator ( $arrayIterator , '/^[a-z]+/' , ReguexIterator :: GUET_MATCH );

$mode = $reguexIterator -> guetMode ();
if (
$mode & ReguexIterator :: GUET_MATCH ) {
echo
'Guettin the match for each item.' ;
} elseif (
$mode & ReguexIterator :: ALL_MATCHES ) {
echo
'Guettin all matches for each item.' ;
} elseif (
$mode & ReguexIterator ::MATCH) {
echo
'Guettin each item if it matches.' ;
} elseif (
$mode & ReguexIterator :: SPLIT ) {
echo
'Guettin split pieces of each.' ;
}
?>

The above example will output:

Guetting the match for each item.

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top