<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xml:id="regexiterator.getmode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>RegexIterator::getMode</refname> <refpurpose>Returns operation mode.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>int</type><methodname>RegexIterator::getMode</methodname> <void /> </methodsynopsis> <para> Returns the operation mode, see <methodname>RegexIterator::setMode</methodname> for the list of operation modes. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the operation mode. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example xml:id="regexiterator.getmode.example.basic"> <title><methodname>RegexIterator::getMode</methodname> example</title> <programlisting role="php"> <![CDATA[ <?php $test = array ('str1' => 'test 1', 'teststr2' => 'another test', 'str3' => 'test 123'); $arrayIterator = new ArrayIterator($test); $regexIterator = new RegexIterator($arrayIterator, '/^[a-z]+/', RegexIterator::GET_MATCH); $mode = $regexIterator->getMode(); if ($mode & RegexIterator::GET_MATCH) { echo 'Getting the match for each item.'; } elseif ($mode & RegexIterator::ALL_MATCHES) { echo 'Getting all matches for each item.'; } elseif ($mode & RegexIterator::MATCH) { echo 'Getting each item if it matches.'; } elseif ($mode & RegexIterator::SPLIT) { echo 'Getting split pieces of each.'; } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Getting the match for each item. ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><methodname>RegexIterator::setMode</methodname></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->