Home > PHP > Function > Multibyte String > mb_strpos()

mb_strpos()

mb_strpos - Find position of first occurrence of string in a string

Syntax

int mb_strpos (string $haystack, string $needle, int $offset, string $encoding)

Arguments

  • haystack - The string being checked.
  • needle - The position counted from the beginning of haystack.
  • offset - The search offset. If it is not specified, 0 is used.
  • encoding - The encoding parameter is the character encoding. If it is omitted, the internal character encoding value will be used.

Description

Finds position of the first occurrence of a string in a string.

Version

PHP 4.0.6, 5

Return value

Returns the numeric position of the first occurrence of needle in the haystack string. If needle is not found, it returns FALSE.