#38221 [Opn->Bgs]: base64_encode produces invalidly encoded string
ID: 38221
Updated by: tony2001@php.net
Reported By: roiputrop at mailinator dot com
-Status: Open
+Status: Bogus
-Bug Type: Mail related
+Bug Type: Strings related
Operating System: Ubuntu 6.06 LTS
PHP Version: 5.1.4
New Comment:
Use chunk_split() to split the string.
http://php.net/chunk_split
Previous Comments:
------------------------------------------------------------------------
[2006-07-26 11:01:50] roiputrop at mailinator dot com
Description:
------------
Calling base64_encode in php does not produce valid base64 encoded
string.
The lines are too long, there should be a line break every 76
characters.
Example code below.
Reproduce code:
---------------
<?
$file = implode( "", file("http://bugs.php.net/gifs/logo-bug.gif")
);
print base64_encode($file);
?>
This produces a string with just one line.
Expected result:
----------------
Base 64. 114 lines of text.
Actual result:
--------------
Not base 64. One line of text.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38221&edit=1
Thread (2 messages)