Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

mb_ereg_search_setpos

Description

The mb_ereg_search_setpos of Multibyte String for PHP set start point of next regular expression match.

Syntax

mb_ereg_search_setpos(
    int $offset
): bool

Parameters

offset

The position to set. If it is negative, it counts from the end of the string.

Return

Returns true on success or false on failure.

Examples

1 · offset · negative

<?

$string = '🐘string';
$pattern = '🐘(st(r(i)ng))';

mb_ereg_search_init($string, $pattern);

$offset = -1;

$return = mb_ereg_search_setpos($offset);

var_export($return);

?>
true

2 · offset · non-negative

<?

$string = '🐘string';
$pattern = '🐘(st(r(i)ng))';

mb_ereg_search_init($string, $pattern);

$offset = 1;

$return = mb_ereg_search_setpos($offset);

var_export($return);

?>
true
HomeMenu