• PHP Video Tutorials

PHP - imap_8bit() Function



PHP−IMAP functions helps you to access email accounts, IMAP stands for Internet Mail Access Protocol using these functions you can also work with NNTP, POP3 protocols and local mailbox access methods.

The imap_8bit() function accepts a string value representing an 8-bit string as a parameter and converts it into a printable string, warps it in quotations and returns the result.

imap_binary() function notranslate"> imap_8bit($str);

Parameters

Sr.No Parameter & Description
1

str (Mandatory)

This is a string value representing the 8bit string to convert.

Return Values

This function returns a string value which is a quoted-printable format of the given string.

PHP Version

This function was first introduced in PHP Version 4 and works in all the later versions.

Example

Following is an example of imap_8bit() function −

<html>
   <body>
      <?php
         $str = "áéíóú";		 
         $result = imap_8bit($str);
         print($result);
      ?>
   </body>
</html>

Output

This generate the following output −

=C3=A1=C3=A9=C3=AD=C3=B3=C3=BA

Example

Following is another example of the above function −

<html>
   <body>
      <?php
         $str = "Alemán ąćęłńóśźż ĄĆĘŁŃÓŚŹŻ";		 
         $result = imap_8bit($str);
         print($result);
      ?>
   </body>
</html>

Output

This generate the following output −

Alem=C3=A1n =C4=85=C4=87=C4=99=C5=82=C5=84=C3=B3=C5=9B=C5=BA=C5=BC =C4=84= =C4=86=C4=98=C5=81=C5=83=C3=93=C5=9A=C5=B9=C5=BB
php_function_reference.htm
Advertisements