So without giving boring details, when I unpack a bunch of stuff and then re-pack it together, it works. But when I unpack a bunch of stuff and then re-pack it in order separately, it doesn't work. WhY??!!?? Example: $this->header = unpack('Lheader_size/Lc_size/Lheader_v/Lu_size/Lblocks', $data) fwrite($this->wp, pack('LLLLL', $this->header['header_size'],$this->header['c_size'],$this->header['header_v'],$this->header['u_size'],$this->header['blocks'])); PHP: that works, the following doesn't $this->header = unpack('Lheader_size/Lc_size/Lheader_v/Lu_size/Lblocks', $data) fwrite($this->wp, pack('L',$this->header['header_size'])); fwrite($this->wp, pack('L',$this->header['c_size'])); fwrite($this->wp, pack('L',$this->header['header_v]'])); fwrite($this->wp, pack('L',$this->header['u_size'])); fwrite($this->wp, pack('L',$this->header['blocks'])); PHP:
there's no syntax error, im playing with a warcraft 3 replay file(it records a played game). warcraft will play the file packed the 1st way, but not the 2nd. also interestingly, i can't see the difference in the file (although there must be one). i tried going through each character and looking at it with dechex(ord($thecharacter)) and the 2 versions look identical
k in my original post it's missing some semicolons.. but they're there in my file.... if that's what you're talking about. it was a rough copy-paste i left out some irrelevant stuff
This line doesn't look a little funny to you ? fwrite($this->wp, pack('L',$this->header['header_v]'])); PHP:
lol what do you know, that fixed it. thanks the funny thing is i still had to look at that line for 5 minutes thinking "i dont see what's wrong with it"