Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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