Get Icon Data

I've managed to extract the url of a favicon on the web, but now I
need to extract the image data to produce something like

data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAF...

I can read the binary data just fine using file_get_contents() but
that's not what I need... does anyone know how to extract the data of
an image like that? I can't even seem to get the mime type, and
reading the file contents as text doesn't produce a string like that
either... it's all just weird characters. I want to pass that data
into <object data="here" />.
mark [ Fr, 01 Februar 2008 06:07 ] [ ID #1921957 ]

Re: Get Icon Data

On Jan 31, 9:07 pm, Mark <mnbaya... [at] gmail.com> wrote:
> I've managed to extract the url of a favicon on the web, but now I
> need to extract the image data to produce something like
>
> data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAF...
>
> I can read the binary data just fine using file_get_contents() but
> that's not what I need... does anyone know how to extract the data of
> an image like that? I can't even seem to get the mime type, and
> reading the file contents as text doesn't produce a string like that
> either... it's all just weird characters. I want to pass that data
> into <object data="here" />.

I guess it should have been obvious that it was encoded in base64
(just figured that out). But still, how can I get the mime type?
mark [ Fr, 01 Februar 2008 06:32 ] [ ID #1921958 ]
PHP » comp.lang.php » Get Icon Data

Vorheriges Thema: xpdf - PHP Script or Snippet
Nächstes Thema: smarty.net down