Created
May 2, 2018 06:37
-
-
Save eyJhb/44775eaa6b52a83f9e56e6dad7329fbb to your computer and use it in GitHub Desktop.
Simple php script to base64 encode file
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 | |
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