guys i wil be glad if someone can explain how i can go about handling binary data, like parsing an image to be dispaly on a browser.

4 Years
Discussion Span
Last Post by DarkMonarch

I've never done this in PHP, but, by 'Binary', i'm guessing that you're trying to parse a binary image? (I.e. black and white)?


yes. actually its like an ftp app that fetches data from a givin url so, incase of image or .doc, .pdf ... files hw do i handle the data.


file_get_contents() should give you the data. allow_url_fopen needs to be 'on' - check your phpinfo(). You'll find it under the Core heading.

I'm pretty sure this is binary-safe. You'll need to check

What do you then want to do with it?

Edited by diafol


thanks guys for your response diafol- how can i make use of socket connection with stream_get_contents() for handling binary if nothing wrks except socket.


hmmm... sockets and php

i didnt implement that part, but i remember when i started at this job, the programmer was bitching about it. so he first did the socket module in flash, then he updated it in html5.

so far i didnt have to work on that part of the software, but look into html5 for socket features.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.