A simple and powerful package to handle base64.
Currently only tested with images (png, jpg, svg, doc, docx, pdf)
- PHP >= 7.1
$base64Handler = new Base64Handler();
Path
$file = 'path/to/file.png';
$convert = $base64Handler->toBase64($file);
URL
$file = 'http://icons.iconarchive.com/icons/graphicloads/100-flat/256/home-icon.png';
$convert = $base64Handler->toBase64($file);
$base64 = 'xyz';
$convert = $base64Handler->toFile($base64);
$base64 = 'xyz';
$getFile = $base64Handler->getBase64Type($base64);
- Check if base64 is a PDF
The Base64 Handler is open-sourced software licensed under the MIT license.
If you find this project useful, you can buy author a glass of juice