Skip to content

Kirby 5.0.4

Str::position()

Returns the position of a needle in a string if it can be found

Str::position(string|null $string, string $needle, bool $caseInsensitive = false): int|false

Parameters

Name Type Default
$string stringornull no default value
$needlerequired string no default value
$caseInsensitive bool false

Return types

intorfalse

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException for empty $needle

Parent class

Kirby\Toolkit\Str