Graham Anderson wrote:
How do you decompress a zlib'd string located in a file with php ?
I need to dynamically write a password string into a movie file.....
It appears that in QuickTime movie API, all sprite variables/values are
zlib'd inside the movie file
So I need to:
find the string
decompress a zlib'd string inside a file.
change its value => password=new_password
recompress the new value
write the zlib'd string back to the file
I'm sure if I can decompress the string, then it will not be too hard
to do the rest :)
I'm sure if you spent 5 seconds searching the manual you would find this page:
http://php.net/manual/en/function.gzuncompress.php
and this one:
http://php.net/manual/en/function.gzcompress.php
(HINT: I typed http://php.net/zlib into the address bar to find them)
'the rest' involves find your substring's beginning and ending offset and then
using those values to 'splice' the new substring (aka password) into the file/stream,
I can visualize how ot do it but have never actually needed to do something like
that ... I would say the compress/decompress is the easier part personally ...
buy hey as long as you get it working :-)
many thanks
back at ya, I learnt some stuff answering (hopefully) you question ;-)
g
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php