2 Test imap_base64() function : basic functionality
5 extension_loaded('imap') or die('skip imap extension not available in this build');
9 /* Prototype : string imap_base64 ( string $text )
10 * Description: Decode BASE64 encoded text.
11 * Source code: ext/imap/php_imap.c
14 echo "*** Testing imap_base64() : basic functionality ***\n";
16 $str = b'This is an example string to be base 64 encoded';
17 $base64 = base64_encode($str);
18 if (imap_base64($base64) == $str) {
24 $str = b'!£$%^&*()_+-={][];;@~#?/>.<,';
25 $base64 = base64_encode($str);
26 if (imap_base64($base64) == $str) {
32 $hex = b'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF';
33 $base64 = base64_encode($hex);
34 if (imap_base64($base64) == $hex) {
43 *** Testing imap_base64() : basic functionality ***