
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

399 Views
The mb_split() function in PHP is used to split a multibyte string using regular expressions. It returns the results in an array format.Syntaxarray mb_split($str_pattern, $str_string, int $limit=-1)Parametersmb_split() accepts the following three parameters −$str_pattern − It is used for the regular expression's pattern.$str_string − It is used to split the string.$limit − It is an optional parameter that is used to specify the limit elements.Return ValuesThe mb_split function will return the split elements result as an array. Or, it will return False on failure.Example 1OutputIt will produce the following output −Array ( [0] => Welcome ... Read More

106 Views
The mb_preferred_mime_name() function in PHP is used to return the MIME string for the character encoding and it returns the charset string. It gets a MIME (Multipurpose Internet Mail Extensions) charset string for the specific encoding.Syntaxstring mb_preferred_mime_name($string_encoding)Parametersmb_preferred_mime_name() accepts only one parameter −$string_encoding − This parameter is used to check the encoding.Return ValuesThe mb_preferred_mime_name() function returns the MIME charset string for the charset encoding. It returns False if no charset is preferred for the given encoding.ExampleLet us now take an example and see how it works −OutputIt will produce the following output −EUC-JP Read More

4K+ Views
Suppose we are given an array 'arr' that contains n number of sorted integer values. We are also given an array 'query' of size q, and we have to tell either the values in ‘query’ are present in the given array 'arr' or not. If a value in query is present in arr, we print "Present" along with the position where the value is situated in. Otherwise, we print "Not present" and print the position in arr, where the minimum value greater than the value in query is located. We have to remember that the arrays are 1-indexed.So, if the ... Read More

646 Views
The mb_parse_str() function in PHP is used to parse the GET, POST, and COOKIE data and it sets the global variable. It parses the URL encoded data and detects the encoding. After that, it converts the coding in the internal encoding and sets values for the global variables. This function is supported in PHP 7 or higher versions.Syntaxstring mb_parse_str($str_string, $array_result)Parametersmb_parse_str() accepts the following two parameters −$str_string − This parameter is used for the URL encoded data.$result − The result parameter will be an array holding the decrypted and character encrypted converted values.Return ValuesThe mb_parse_str() function returns True on success or ... Read More

2K+ Views
In PHP, we can use the mb_ord() function to get the Unicode code point value of a given character. This function is supported in PHP 7 or higher versions. The mb_ord() function complements the mc_chr() function.Syntaxint mb_ord($str_string, $str_encoding)Parametersmb_ord() accepts the following two parameters −$str_string − This parameter is used for the string.$str_encoding − This is the character encoding parameter. If it is absent or NULL, then we can use the internal encoding value.Return Valuesmb_ord() returns the Unicode point value for the first character from the given string. It will return False on failure.ExampleOutputIt will produce the following output −Get the ... Read More

321 Views
The mb_list_encodings() function in PHP is used to return an array of all supported encodings. This function is supported in PHP 5 or higher version.Syntaxarray mb_list_encodings()Parametersmb_list_encodings() takes no parameters.Return ValuesThis function returns a numerically indexed array.Errors/Exceptionsmb_list_encodings() does not produce any errors.Examplemb_list_encodings() does not produce any errors.OutputIt will produce the following output −array(87) { [0]=> string(4) "pass" [1]=> string(4) "auto" [2]=> string(5) "wchar" [3]=> string(7) "byte2be" [4]=> string(7) "byte2le" [5]=> string(7) "byte4be" [6]=> string(7) "byte4le" [7]=> string(6) "BASE64" [8]=> string(8) "UUENCODE" [9]=> string(13) ... Read More

378 Views
The mb_http_output() function in PHP is used to get or set the HTTP output character encoding. An output, after this function is called, will be converted from the set internal encoding to the specified encoding.Syntaxstring|bool mb_http_output(str $encoding = null)Parametersmb_http_output() accepts only a single parameter −$encoding − It is used to set the HTTP output character encoding to the encoding. If the encoding is omitted, then mb_http_output() will return the current HTTP output character encoding.Return ValuesIf the encoding is omitted, then the mb_http_output() function will return the current HTTP output character encoding. Otherwise, it returns True on success and False on ... Read More

596 Views
The mb_http_input() function in PHP is used to detect the HTTP (Hyper-text transfer protocols) input character encoding. This function is supported in PHP 5.4 or higher version.Syntaxarray|string mb_http_input(str $type=null)Parametersmb_http_input() accepts only a single parameter −$type − In the type parameter, the input string specifies the input type, like −G is used for GET, P is used for POST, C is used for COOKIE, S is used for STRING, L is used for LIST, andI for the whole list (it will return array).If the type is omitted, then it returns the last input type processed.Return Valuesmb_http_input() returns the character encoding name ... Read More

155 Views
The mb_get_info() function in PHP is used to get the internal settings of mbstring. This function is supported in PHP 5.4 or higher version.Syntaxarray|string|int mb_get_info(str $type = "all")ParametersIt accepts only a single parameter to get the multibyte information.$type − If the type parameter is not specified or it is specified as "all", then it will return the following information −"internal_encoding", "http_input", "http_output", "http_output_conv_mimetypes", "mail_charset", "mail_header_encoding", "mail_body_encoding", "illegal_chars", "encoding_translation", "language", "detect_order", "substitute_character", "strict_detection" If the type parameter is specified as any of the following −"internal_encoding", "http_input", "http_output", "http_output_conv_mimetypes", "mail_charset", "mail_header_encoding", "mail_body_encoding", "illegal_chars", "encoding_translation", "language", "detect_order", "substitute_character" or "strict_detection", then it will ... Read More

238 Views
In PHP, mb_eregi_replace() is used to replace a regular expression with a multibyte support, ignoring case. This function will scan the string for matches to the pattern, then it will replace the matched text with the replacement. This function is supported in PHP 4.2 or higher version.Syntaxstring mb_eregi_replace(str $pattern, str $replacement, str $string, str $options)Parametersmb_eregi_replace() accepts the following four parameters −$pattern − This parameter is used for the regular expression pattern and it may be used multibyte characters. The case will be ignored.$replacement − This parameter is used for text replacement.$string − The string parameter is used to search the ... Read More