1tomany / php-data-uri
A simple, low dependency library to work with RFC 2397 data URIs
v2.3.0
2025-03-31 19:05 UTC
Requires
- php: >=8.4
- ext-fileinfo: *
- symfony/filesystem: ^7.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.74
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
README
This simple library exposes a single method, \OneToMany\DataUri\parse_data()
that allows you to easily parse base64 encoded data URIs or valid file paths. During parsing, a temporary, uniquely named file will be created and an immutable value object of type \OneToMany\DataUri\DataUri
will be returned.
Instances of the DataUri
object will attempt delete temporary file it references upon object destruction.
Installation
composer require 1tomany/php-data-uri
Example
See the parse_example.php
file for examples on how to use the parse_data()
method.
Credits
License
The MIT License