Re: How to Looking at Raw Binary Data with PHP and curl
| From: | Jasper Bryant-Greene | Date: | Sat, 24 Sep 2005 21:25:52 +0000 |
| Subject: | Re: How to Looking at Raw Binary Data with PHP and curl | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-223129@lists.php.net to get a copy of this message | ||
Graham Anderson wrote:
How do you display raw binary data of a file sent from a server with curl ?You can probably just use file_get_contents() if allow_url_fopen is enabled (it is by default). For binary data, base64_encode and it's friend base64_decode allow you to encode and decode binary data in a normal ASCII string. http://php.net/file_get_contents http://php.net/base64_encode
I want to encrypt the file with something akin to str_replace and decode it on the other side with a custom data handler Just want to make sure that I am str_replace'ing the actual data and not a representation of it :)str_replace is not for encryption. You might want to look at mcrypt, as using str_replace is probably just as bad as sending the unencrypted string. It's not going to be secure. http://php.net/mcrypt -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/