Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 9th, 2011  |  syntax: PHP  |  size: 0.22 KB  |  views: 274  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. function base64_encode_image ($filename=string,$filetype=string) {
  3.     if ($filename) {
  4.         $imgbinary = fread(fopen($filename, "r"), filesize($filename));
  5.         return base64_encode($imgbinary);
  6.     }
  7. }
  8. ?>