Hello I need to convert this VB6 function into a php function. When I input "loffkkcgjnaeokqdqgmj" into the function it should output "[login to view URL]:17478". Thanks
'//////////////CODE START
Public Function LW2IP(sLWKey As String) As String
On Error GoTo err
Dim key As String
Dim Ip As String
Dim ippointer As Long
Dim keypointer As Long
Dim LWKey As String
LWKey = sLWKey
key = "TYXUYZUVXWSTZSWSZSVRT"
ippointer = 12
keypointer = 1
Ip = ""
Do Until ippointer = Len(LWKey) - 13
Ip = Ip & Chr$(Asc(Mid$(LWKey, ippointer, 1)) - Asc(Mid$(key, keypointer, 1)) + 32)
ippointer = ippointer + 1
keypointer = keypointer + 1
Loop
LW2IP = Replace(Ip, " ", vbNullString)
Exit Function
err:
LW2IP = "invalid ip"
End Function
'/////////////////CODE STOP