Last active
February 15, 2016 08:05
-
-
Save MatthieuScarset/537fc972f13234cf9d6c to your computer and use it in GitHub Desktop.
PHP - encode_file64
This file contains 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 | |
// Encode a file to base64 | |
function encode_file64($path, $print = false) { | |
$file = file_get_contents($path); | |
$e = base64_encode($file); | |
if( $print ) | |
print ($e); | |
return $e; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment