Skip to content

Kirby 4.4.1

Str::position()

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

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

Parameters

Name Type Default
$string * string|null
$needle * string
$caseInsensitive bool false

Return type

int|false

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException for empty $needle

Parent class

Kirby\Toolkit\Str