PHP imap_base64() Function Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The imap_base64() function is an inbuilt function in PHP that is used to decode the base64 encoded text. Syntax: imap_base64(string $string)Parameters: This function accepts only one parameter which is described below. $string: This is the base64 string parameter that is going to be decoded.Return Values: The imap_base64() function returns the decoded string if this function successfully executes otherwise this function will return "false". Program 1: The following program demonstrates the imap_base64() function. Note: Before using this function, check if this function is available in your environment or not. If not then type this command apt-get install php-imap For installation, please refer to the following also. How to Install imap extension in PHP on Windows?How to Install imap extension in PHP on Linux?Program 1: PHP <?php $string = "RGVjb2RlIHRoaXMgc2ltcGxlIHN0cmluZw=="; $decodestring = imap_base64($string); echo "Decoded Data: $decodestring" . PHP_EOL; ?> Output: Decoded Data: Decode this simple stringProgram 2: The following program demonstrates the imap_base64() function. PHP <?php $string = "RGVjb2RlIHRoaXMgc2ltcGxlIHN0cmluZw=="; $string2 = "aGV5IGJ1ZGR5IAo="; if (imap_base64($string) == imap_base64($string2)) { echo "Both strings are equal"; } else { echo "Both strings are not equal"; } ?> Output: Both strings are not equal Reference: https://www.php.net/manual/en/function.imap-base64.php Comment More infoAdvertise with us Next Article PHP imap_base64() Function N neeraj3304 Follow Improve Article Tags : PHP PHP-function PHP-IMAP Similar Reads PHP imap_binary() Function The imap_binary() function is an inbuilt function in PHP that is used to convert the 8-bit string into the base64 encoding. This function is used by some IMAP servers to represent mailbox names that contain non-ASCII characters or certain ASCII characters that are special in IMAP. Syntax: imap_binar 2 min read PHP | base64_encode() Function The base64_encode() function is an inbuilt function in PHP that is used to encode data with MIME base64. MIME (Multipurpose Internet Mail Extensions) base64 is used to encode the string in base64. The base64_encoded data takes 33% more space than the original data. Syntax: string base64_encode( $dat 1 min read PHP | base64_decode() Function The base64_decode() is an inbuilt function in PHP which is used to Decodes data which is encoded in MIME base64.Syntax: string base64_decode( $data, $strict ) Parameters: This function accepts two parameter as mentioned above and described below: $data: It is mandatory parameter which contains the e 1 min read PHP | imagebmp() Function The imagebmp() function is an inbuilt function in PHP which is used to return the output or save a BMP version of the given image. Syntax: bool imagebmp( resource $image, mixed $to, bool $compressed ) Parameters: This function accept three parameters as mentioned above and described below: $image: I 1 min read PHP base_convert( ) Math Function The base_convert() function in PHP is used to convert a number given in an arbitrary base to a desired base. Both the base should be between 2 and 32 and bases with digits greater than 10 are represented with letters a-z i.e 10 is represented as a, 11 is represented as b and 35 is represented as z. 2 min read Like