-
-
Save abada/8d2502e3eb1b3206be7a77dab985c5af to your computer and use it in GitHub Desktop.
Converting a binary file to base64 encoding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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