Urmila Samariya has Published 135 Articles

PHP – How to get the selected part of a string using mb_substr()?

Urmila Samariya

Urmila Samariya

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

2K+ Views

In PHP, mb_substr() is used to return the selected part of a given string. The multibyte safe substr() works based on the number of characters. It counts the position from the starting of the string. It will return 0 for the first character position and 1 for the second position ... Read More

PHP – Case folding in a string using mb_convert_case()

Urmila Samariya

Urmila Samariya

Updated on 23-Aug-2021 08:28:32

482 Views

mb_convert_case() is an inbuilt function in PHP that is used to perform case folding on a given string.Syntaxstring mb_convert_case(str $string, int $mode, str $encoding)Parametersmb_convert_case() accepts three parameters: $string, $mode and $encoding to perform case folding on a string.$string− This parameter is used to return the string being converted.$mode: The mode parameter is ... Read More

PHP – How to return character by Unicode code point value using mb_chr()?

Urmila Samariya

Urmila Samariya

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

823 Views

In PHP, the mb_chr() function is used to return character by Unicode code point value. This function returns a string having the character identified by the Unicode code point value, encoded in the specified encoding.Syntaxstring mb_chr(int $codepoint, string $encoding)Parametersmb_chr() accepts only two parameters: $codepoint and $encoding.$codepoint− This parameter is used to ... Read More

PHP – Check if strings are valid for the specified encoding using mb_check_encoding()

Urmila Samariya

Urmila Samariya

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

934 Views

In PHP, the mb_check_encoding() function is used to check if the given strings are valid for the specified encoding. This function checks if the specified byte stream is valid for the specified encoding.Syntaxbool mb_check_encoding(str $value=null, str $encoding=null)Note: The function will check if the stated byte stream is valid for the ... Read More

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

Urmila Samariya

Urmila Samariya

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

1K+ Views

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

258 Views

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

257 Views

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

465 Views

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

344 Views

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

310 Views

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

Previous 1 ... 4 5 6 7 8 ... 14 Next
Advertisements