Hi, I desperately need help from a php guru.

I am currently converting an asp.net site to php. The existing asp.net site retrieves images from a sqlserver database in the form of byte arrays. A byte array can then be instantly rendered to a page by using the following two lines (where bytArray is my byte array object):-

Response.ContentType = "Image/png"
Response.BinaryWrite(bytArray)

job done.

Simple huh! But can I find a way to do this using php? can I heck!

I have searched and searched for an answer but cannot find anything. I am learning php at the mo, have I missed something obvious? surely there must be a simple way to render a byte array to a php page?

    The first line in PHP would be

    header('Content-Type: image/png');

    As for the second: What form is the image data in at the moment? Is it an array of bytes (echo join(array_map('chr',$bytArry));)? An array of characters(echo join($bytArry);)? A string (echo $bytArry;)? Anything? What you do depends on what you have.

      Write a Reply...