note 25259 deleted from function.base64-encode by didou

From: Date: Sat, 16 Aug 2003 15:05:24 +0000
Subject: note 25259 deleted from function.base64-encode by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54379@lists.php.net to get a copy of this message
Note Submitter: emaman@upandup.net ---- Here is a workaround for the base64_encode function under Win32. 1) Download the base64.exe program from http://www.fourmilab.ch/. 2) Write your own base64 encode function : function mybase64_encode($s) { $tmpfname = tempnam("", "tmp"); $fp = fopen($tmpfname, "w+"); if ( $fp ) { fwrite ($fp, $s); fclose($fp); exec("c:/bin/base64 -e " . $tmpfname . " " . $tmpfname . ".b64"); $fp = fopen($tmpfname . ".b64", "r"); $contents = fread($fp,filesize($tmpfname . ".b64")); fclose($fp); unlink($tmpfname); unlink($tmpfname . ".b64"); return($contents); } } With this function you don't need to call the chunk_split function.

« previous php.notes (#54379) next »