How to Looking at Raw Binary Data with PHP and curl

From: Date: Sat, 24 Sep 2005 19:32:16 +0000
Subject: How to Looking at Raw Binary Data with PHP and curl
Groups: php.general 
Request: Send a blank email to php-general+get-223128@lists.php.net to get a copy of this message
How do you display raw binary data of a file sent from a server with curl ? When I curl a movie file with curl -l -i "path2file/file.php",I get the below output in my Terminal. file.php: $find = array($find1,$find2,$find3,$find4); $replace = array($replace1,$replace2,$replace3,$replace4);
    if( $fd  = fopen($filepath, 'rb')){
     while(!feof($fd)) {
	echo str_replace($find,$replace,  fread($fd, $chunkSize));  //read and encode
}
     fclose ($fd);
     exit;
} 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 :) I am am bit new to this and deep in experimentation so any help is appreciated :) g -------------------- output: ETag: 26a774b8e648b52c24f01c7277ce597f Accept-Ranges: bytes Content-Length: 24113190 Cache-Control: no-cache, must-revalidate Content-Type: video/quicktime ftypqt qt ??moovlmvhd??׾??X-?@Tftrak\tkhd??s???-?@$edtselst-?S?mdia mdhd??׾???D?:hdlrmhlrsounapplyApple Sound Media HandlerS|minfsmhd9hdlrdhlralisappl?Apple Alias Data Handler$dinfdref
                                                                                                                                                                                            alisSstbl?stsd?mp4a???Dcwave
                                                                                                                                                                                                                        frmamp4a
                                                                                                                                                                                                                                mp4a3esds???"???@???????ostts:kNXstsc?
                                                                                                                                                                                                                                     123?56789:;????????????????????????????????????????????????????????????????????????????????????????????????????????


« previous php.general (#223128) next »