WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World
Encode string for MIME header

mb_encode_mimeheader

(PHP 4 >= 4.0.6, PHP 5)

mb_encode_mimeheaderEncode string for MIME header

Description

string mb_encode_mimeheader ( string $str [, string $charset [, string $transfer_encoding [, string $linefeed [, int $indent ]]]] )

Encodes a given string str by the MIME header encoding scheme.

Parameters

str

The string being encoded.

charset

charset specifies the name of the character set in which str is represented in. The default value is determined by the current NLS setting (mbstring.language). mb_internal_encoding() should be set to same encoding.

transfer_encoding

transfer_encoding specifies the scheme of MIME encoding. It should be either "B" (Base64) or "Q" (Quoted-Printable). Falls back to "B" if not given.

linefeed

linefeed specifies the EOL (end-of-line) marker with which mb_encode_mimeheader() performs line-folding (a » RFC term, the act of breaking a line longer than a certain length into multiple lines. The length is currently hard-coded to 74 characters). Falls back to "\r\n" (CRLF) if not given.

indent

Indentation of the first line (number of characters in the header before str ).

Return Values

A converted version of the string represented in ASCII.

Changelog

Version Description
5.0.0 The indent parameter was added.

Examples

Example #1 mb_encode_mimeheader() example

<?php
$name 
""// kanji
$mbox "kru";
$doma "gtinn.mon";
$addr mb_encode_mimeheader($name"UTF-7""Q") . " <" $mbox "@" $doma ">";
echo 
$addr;
?>

Notes

Note: This function isn't designed to break lines at higher-level contextual break points (word boundaries, etc.). This behaviour may clutter up the original string with unexpected spaces.

See Also


Scramble Eggs - php class to scramble/encode
Categories : PHP, PHP Classes, Security, Encryption
Count how many weeks in the month have a specified day, such as Mon, Tue, etc. Var avail - number of days - first day name of the month, occurrences of Sun, occurrences of Mon, etc. Allows you to calculate number of working hours exclude Holidays.
Categories : Calendar, Date Time, PHP, Databases, MySQL
Adding dashes to credit card numbers
Categories : Strings, Credit Cards, PHP



OPiuM - stock Options Portfolio Manager for PHP and mySQL (secure encode/decode)
Categories : PHP, Complete Programs, MySQL
Embed Videos
Categories : PHP, HTML and PHP, Beginner Guides
PHP MIME Decoder. This class decodes Mime Encoded email message. Attachments are stored in a director. Works with Multipart/alternative, multipart/mixed etc. see http://p3mail.com for example.
Categories : PHP, PHP Classes, Email
Adds dashes to a CC number. Was from this site, but now it works.
Categories : PHP, Credit Cards
Permutations, Combinations and Factorials
Categories : PHP, PHP Classes, Math.
Class for sending mail with MIME attachments in multipart format using external sendmail, mimencode and zip
Categories : Email, Network, PHP, PHP Classes
A very useful function to display text on specified number of characters.
Categories : PHP, Strings
This function returns a random string of a specified number of digits without leading zeros. For example, if three digits are specified, the function will return a random three-digit number from 100 to 999.
Categories : Algorithms, PHP
Numbers to words
Categories : PHP, PHP Classes
Show Source with Line Numbers
Categories : PHP, Regexps, Filesystem
How to limit the number of records returned by a query in PostgreSQL
Categories : Databases, PostgreSQL