As a \"look under the covers\" tutorial for myself I am building a PHP script to gather emails from a POP3 mailbox. While attempting to make use of binary attachments I am
If you have a lot of data to write out that needs to be decoded before writing I would suggest using stream filters so decode the data as you write it...
$fh = fopen('where_you_are_writing', 'wb');
stream_filter_append($fh, 'convert.base64-decode');
// Do a lot of writing here. It will be automatically decoded from base64.
fclose($h);