class io_dz {
/**
* Compress
*/
public static function Set($Data) {
if ($Data) {
$Out = addslashes(gzcompress(serialize($Data), 9));
} else {
$Out = FALSE;
}
return $Out;
}
/**
* Decompress
*/
public static function Get($Data) {
if ($Data) {
$Out = unserialize(gzuncompress(stripslashes($Data)));
} else {
$Out = FALSE;
}
return $Out;
}
}
這是serialize函數之前的簡單壓縮。我如何調用該函數,並用它在$data
我目前有:如何在PHP類中使用這個函數?
$dataCompressor = new $io_dz();
$cdata = $dataCompressor->Set($data);
但它似乎沒有工作,任何幫助,將不勝感激!
謝謝!
太謝謝你了! – Mohammad 2011-03-25 16:42:30