- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
PHP – mb_preferred_mime_name() function
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.
Syntax
string mb_preferred_mime_name($string_encoding)
Parameters
mb_preferred_mime_name() accepts only one parameter −
$string_encoding − This parameter is used to check the encoding.
Return Values
The 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.
Example
Let us now take an example and see how it works −
<?php // Encoding $string_encoding = "EUC-JP"; mb_http_output($string_encoding); // output control function is used ob_start("mb_output_handler"); header(mb_preferred_mime_name($string_encoding)); print_r($string_encoding); ?>
Output
It will produce the following output −
EUC-JP
Advertisements