PHP Function Iconv_Strpos
The php function iconv_strpos helps us to find the position of the first occurrence of a string in another string. It works similar to the strpos() & stripos() Functions but is case insensitive & supports multiple encodings.
The function takes three parameters-$haystack, $needle & $offset. The $haystack parameter specifies the whole string, the $needle is the substring that we are looking for & the $offset is the position from which we want to start the search. If the $offset is negative then it will start counting from the end of the string. The $encoding parameter is optional if omitted the string will be assumed to be encoded in iconv.internal_encoding.
The iconv_strpos() function converts the haystack string from the current encoding to the target encoding & if the string has an iconv_strlen alias with the word //TRANSLIT appended to it then transliteration is enabled if not, then it is disabled. It also returns the position of the first occurrence of the needle in the haystack if it finds it else false. If the return value is not a Boolean or is not one of the supported types then it will return a FALSE value, just like in PHP 7. You can specify the type of a function's return by adding the required type right before the opening curly bracket of the function. It will prevent PHP from throwing a fatal error on a type mismatch. For this, we must have the ext/iconv extension installed on our system.