convertEncoding = $encodingUpper; } if ($convertEncoding !== null) { if ($encodingUpper !== strtoupper($convertEncoding)) { throw new Exception\InvalidArgumentException( 'Wrapper doesn\'t support to convert between character encodings' ); } $this->convertEncoding = $encodingUpper; } else { $this->convertEncoding = null; } $this->encoding = $encodingUpper; return $this; } /** * Returns the length of the given string * * @param string $str * @return int|false */ public function strlen($str) { return strlen($str); } /** * Returns the portion of string specified by the start and length parameters * * @param string $str * @param int $offset * @param int|null $length * @return string|false */ public function substr($str, $offset = 0, $length = null) { return substr($str, $offset, $length); } /** * Find the position of the first occurrence of a substring in a string * * @param string $haystack * @param string $needle * @param int $offset * @return int|false */ public function strpos($haystack, $needle, $offset = 0) { return strpos($haystack, $needle, $offset); } }