normeno / base64-handler
Base64 Handler
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/normeno/base64-handler
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is not auto-updated.
Last update: 2025-10-19 09:42:34 UTC
README
A simple and powerful package to handle base64.
Currently only tested with images (png, jpg, svg, doc, docx, pdf)
Requirements
- PHP >= 7.1
Usage
Init library
$base64Handler = new Base64Handler();
File to Base64
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 to File
$base64 = 'xyz'; $convert = $base64Handler->toFile($base64);
Check base64 type
$base64 = 'xyz'; $getFile = $base64Handler->getBase64Type($base64);
TO-DO
- Check if base64 is a PDF
License
The Base64 Handler is open-sourced software licensed under the MIT license.
Donate
If you find this project useful, you can buy author a glass of juice