Using data URIs in PHP
You can find a link to the class below, along with some examples of how to use it.
The DataUri class should not be used for validation! I developed it for convenience, not security.
Below are a number of examples showing how the DataUri class can used for reading and constructing data URIs.
Data URI to image
The main reason for creating the class. Below shows how the class can be used to parse a data URI containing image data - in my case it was a data URI produced by the HTML Canvas Element's toDataURL() function.
Image to data URI
Easily convert an image to a data URI, which in this instance is being used for an Image element.
Font to data URI
Use the DataUri class to easily generate a data URI to store a font-face in CSS.