Urmila Samariya has Published 145 Answers

PHP – Convert a string to a requested character encoding using iconv()

Urmila Samariya

Urmila Samariya

Updated on 23-Aug-2021 08:25:44

In PHP, the iconv() function is used to convert a string to the requested character encoding. It is used to perform a character set conversion on the string "string" from from_encoding to to_encoding.Syntaxstring iconv(str $from_encoding, str $to_encoding, str $string)ParametersThe iconv() function accepts three parameters: $from_encoding, $to_encoding and $string.$from_encoding− This parameter is used ... Read More

PHP – How to cut out part of a string using iconv_substr()?

Urmila Samariya

Urmila Samariya

Updated on 23-Aug-2021 08:24:27

In PHP, the iconv_substr() function is used to cut a portion of a specified string by the offset and length parameters. Suppose we have a string "helloWorld" and we want to cut and show only the string (llowo), then we will select it by using numbers from 2 to 5.Syntaxstring ... Read More

PHP – Find the last occurrence of a needle within a haystack using the iconv_strrpos() function

Urmila Samariya

Urmila Samariya

Updated on 23-Aug-2021 08:22:54

In PHP, the iconv_strrpos() function is used to findsthe last occurrence of a needle within a haystack. Or, we can say that the iconv_strrpos() function returns the last character number from the haystack.Syntaxstring iconv_strrpos(string $haystack, str $needle, str $encoding)Parametersiconv_strrpos() accepts three parameters: $haystack, $needle and $encoding.$haystack− It denotes the whole ... Read More

PHP – iconv_strpos() function – Find the position of the first occurrence of a needle in a haystack

Urmila Samariya

Urmila Samariya

Updated on 23-Aug-2021 08:21:44

In PHP, the iconv_strpos() function is used to read the first character from a given string. It finds the position of the first occurrence of a character in a string. It is an inbuilt function in PHP.Syntaxstring iconv_strpos(string $haystack, string $needle, int $offset, string $encoding)Note: strpos(), the return value of ... Read More

PHP – How to return the character count of a string using iconv_strlen()?

Urmila Samariya

Urmila Samariya

Updated on 23-Aug-2021 08:20:50

In PHP, the iconv_strlen() function is used to return the character count of a given string. This is an inbuilt function in PHP that is first used in PHP 5 version. Encoding is nullable from PHP 8.0.Syntaxstring iconv_strlen(str $string, str $encoding)ParametersThis PHP function accepts two parameters: $string and $encoding.$string− The ... Read More

PHP – Compose a MIME header field using iconv_mime_encode() function

Urmila Samariya

Urmila Samariya

Updated on 21-Aug-2021 15:10:01

In PHP, iconv_mime_encode() function is used to composes a MIME header field. This is an inbuilt PHP function.Syntaxstring iconv_mime_encode(string $field_name, string $field_value, array $options=[])The iconv_mime_encode() function is used to compose and return a string that represents a valid MIME header field, which looks like -Subject: =ISO-8859-1?Q?Pr=FCfung_f=FFCr?= Entwerfen von einer MIME ... Read More

PHP – Set the current setting for character encoding conversion using iconv_set_encoding() function

Urmila Samariya

Urmila Samariya

Updated on 21-Aug-2021 07:51:05

In PHP, the iconv_set_encoding() function is used to set the current character encoding conversion. It is an inbuilt function in PHP that changes the value of the internal configuration variable specified by type to encoding.Syntaxstring iconv_set_encoding(string $type, string $encoding)Parametersiconv_set_encoding() takes two parameters − $type and $encoding.$type − The $type parameter can ... Read More

PHP – How to decode a MIME header field using iconv_mime_decode() function?

Urmila Samariya

Urmila Samariya

Updated on 21-Aug-2021 07:46:06

In PHP, iconv_mime_decode() function is used to decode a MIME header field. This is an inbuilt function in PHP that is used from the PHP 5 version.SyntaxString iconv_mime_decode(string $string, int $mode, string $encoding)ParametersThe iconv_mime_decode() accepts three different parameters− $string, $mode and $encoding. $string and $mode are mandatory parameters, but $encoding ... Read More

PHP – Decode multiple MIME header fields at once using iconv_mime_decode_headers()

Urmila Samariya

Urmila Samariya

Updated on 21-Aug-2021 07:44:06

In PHP, iconv_mime_decode_headers() function is used to decode multiple MIME header fields at once. It is an in-built function in PHP.Syntaxiconv_mime_decode_headers($str_headers, $int_mode, $str_encoding)ParameterThe iconv_mime_decode_headers() function accepts three different parameters− $headers, $mode and $encoding.$headers − The $header parameter is used for the encoded headers. It is a string type parameter.$mode − ... Read More

PHP – Retrieve internal configuration variables of iconv extension using iconv_get_encoding() function

Urmila Samariya

Urmila Samariya

Updated on 21-Aug-2021 07:41:51

In PHP, the iconv_get_encoding() function is used to retrieve the internal configuration variables of iconv extension. This function is an inbuilt PHP function which is being used from PHP 4 version.Syntaxmixed iconv_get_encoding($type = "all")ParameterThe iconv_get_encoding() function is used only single parameter $type.$type − The values of the optional type parameter ... Read More

Previous 1 ... 4 5 6 7 8 9 10 ... 15 Next
Advertisements