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

This package is auto-updated.

Last update: 2025-03-31 19:07:30 UTC


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