How do I detect whether or not a string has been compressed? I'm getting the following error: warning: gzuncompress() [function.gzuncompress]: data error I'd like to test the data before passing it to gzuncompress, but can't find the required function. Cheers, fcmisc.
The only way I can think of helping with your problem is by using the gzuncompress function to check to see if it has been compressed. if (!gzuncompress($string)) { //string hasn't been compressed } else { //string has been compressed } PHP: