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.

Recommended Answers

All 8 Replies

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.

Member Avatar for diafol

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?

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.

DarkMonarch thanks for that link is helpful.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.