Skip to content

Instantly share code, notes, and snippets.

@eyJhb
Created May 2, 2018 06:37
Show Gist options
  • Save eyJhb/44775eaa6b52a83f9e56e6dad7329fbb to your computer and use it in GitHub Desktop.
Save eyJhb/44775eaa6b52a83f9e56e6dad7329fbb to your computer and use it in GitHub Desktop.
Simple php script to base64 encode file
<?php
if(count($argv) < 3) {
die("php base64 <input filename> <output filename>\n");
}
$input = $argv[1];
$output = $argv[2];
$file_content = file_get_contents($input);
$encoded = base64_encode($file_content);
return file_put_contents($output, $encoded);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment