public static method

Finds the position of the first occurrence of a string within a string. Multibyte enabled version of strpos().

Not all adapters must support interpreting - thus applying - passed numeric values as ordinal values of a character.


  • string $haystack

    The string being checked.

  • string $needle

    The string to find in the haystack.

  • integer $offset

    If specified, search will start this number of characters counted from the beginning of the string. The offset cannot be negative.

  • array $options

    Allows for selecting the adapter to use via the name options. Will use the 'default' adapter by default.



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


	public static function strpos($haystack, $needle, $offset = 0, array $options = array()) {
		$defaults = array('name' => 'default');
		$options += $defaults;
		return static::adapter($options['name'])->strpos($haystack, $needle, $offset);