This can be used to create Data URLs for injection into CSS, JavaScript, or other
non-XML/HTML content. If you are working with QP objects, you may want to use
dataURL() instead.
public static encodeDataURL ( mixed $data, string $mime = 'application/octet-stream', resource $context = null ) | ||
$data | mixed | The contents to inject as the data. The value can be any one of the following: - A URL: If this is given, then the subsystem will read the content from that URL. THIS MUST BE A FULL URL, not a relative path. - A string of data: If this is given, then the subsystem will encode the string. - A stream or file handle: If this is given, the stream's contents will be encoded and inserted as data. (Note that we make the assumption here that you would never want to set data to be a URL. If this is an incorrect assumption, file a bug.) |
$mime | string | The MIME type of the document. |
$context | resource | A valid context. Use this only if you need to pass a stream context. This is only necessary if $data is a URL. (See {@link stream_context_create()}). |