Skip to content

Instantly share code, notes, and snippets.

@nolim1t
Created October 13, 2009 04:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nolim1t/208993 to your computer and use it in GitHub Desktop.
Save nolim1t/208993 to your computer and use it in GitHub Desktop.
Converting a binary file to base64 encoding
<?php
$file="/parh/to/binary";
$fp = fopen($file, "rb");
$binary = fread($fp, filesize($file));
echo base64_encode($binary);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment