Can anyone help me convert this VB function to PHP
- I know php but no idea where to start
Public Function Decompress(ByVal compressedString As String) As String
'Dim gzBuffer As Byte() = Convert.FromBase64String(compressedString)
Dim gzBuffer As Byte() = HexToByte(compressedString)
Using stream As New GZipStream(New MemoryStream(gzBuffer), CompressionMode.Decompress)
Const size As Integer = 4096
Dim buffer As Byte() = New Byte(size - 1) {}
Using memory As New MemoryStream()
Dim count As Integer = 0
Do
count = stream.Read(buffer, 0, size)
If count > 0 Then
memory.Write(buffer, 0, count)
End If
Loop While count > 0
Return Encoding.UTF8.GetString(memory.ToArray())
End Using
End Using
End Function