Skip to content

Instantly share code, notes, and snippets.

@MatthieuScarset
Last active February 15, 2016 08:05
Show Gist options
  • Save MatthieuScarset/537fc972f13234cf9d6c to your computer and use it in GitHub Desktop.
Save MatthieuScarset/537fc972f13234cf9d6c to your computer and use it in GitHub Desktop.
PHP - encode_file64
<?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