mb_ereg_search_setpos()

mb_ereg_search_setpos() — Set start point of next regular expression match.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

mb_ereg_search_setpos() sets the starting point of a match for mb_ereg_search().

Signature

mb_ereg_search_setpos(int $offset): bool

Parameters

ParameterTypeWhat it takes
$offsetintThe position to set. If it is negative, it counts from the end of the string.

Return value

Returns true on success or false on failure.

Example

The PHP manual ships no example for mb_ereg_search_setpos(); the signature and the parameter table above are the contract.

Changelog

VersionChange
7.1.0Support for negative offsets has been added.

See also

mb_regex_encoding(), mb_ereg_search_init()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page mb_ereg_search_setpos() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.