Selesai

Convertir Código visual a PHP

Projek ini berjaya disempurnakan oleh ddonari untuk $44 USD dalam hari.

Dapatkan sebut harga percuma untuk projek seperti ini
Bajet Projek
$30 - $250 USD
Diselesaikan Dalam
1 hari
Jumlah Bida
11
Penerangan Projek

La funcion original esta en Fox, La misma fue convertida a Visual , y Ahora se necesita converir la misma a PHP

Public Function digverif(ByVal cadena As String) As String

' muni zapala codigo original que mando esta hecho en FOX retorna 2 digitos

' LPARAMETERS [url removed, login to view]

' [url removed, login to view] = 0

' secuencia = 3

' [url removed, login to view] = SUBSTR([url removed, login to view], 1, 1)

' [url removed, login to view] = Val([url removed, login to view]) * 1

' [url removed, login to view] = [url removed, login to view] + ([url removed, login to view])

' For [url removed, login to view] = 2 To Len([url removed, login to view]) Step 1

' [url removed, login to view] = SUBSTR([url removed, login to view], [url removed, login to view], 1)

' [url removed, login to view] = Val([url removed, login to view]) * secuencia

' [url removed, login to view] = [url removed, login to view] + ([url removed, login to view])

' secuencia = secuencia + 2

' if secuencia=11

' secuencia = 3

' End If

' Next [url removed, login to view]

' [url removed, login to view] = MOD(int([url removed, login to view]), 10)

' [url removed, login to view] = mod(int(([url removed, login to view]+([url removed, login to view]*secuencia))/2),10)

' [url removed, login to view] = [url removed, login to view] + alltrim(Str([url removed, login to view])) + alltrim(Str([url removed, login to view]))

' [url removed, login to view] = [url removed, login to view]

' RETURN [url removed, login to view]

' CODIGO CONVERTIDO A VISUAL BASIC

suma = 0

secuencia = 3

letra = Mid(cadena, 1, 1)

valorreal = Val(letra) * 1

suma = suma + (valorreal)

For co = 2 To Len(cadena) Step 1

letra = Mid(cadena, co, 1)

valorreal = Val(letra) * secuencia

suma = suma + (valorreal)

secuencia = secuencia + 2

If secuencia = 11 Then

secuencia = 3

End If

Next co

checksum = Int(suma / 2) Mod 10

checksum2 = Int((suma + (checksum * secuencia)) / 2) Mod 10

digverif = Trim(Str(checksum)) + Trim(Str(checksum2))

End Function

Diselesaikan oleh:
Kemahiran Diperlukan

Mencari untuk memperoleh sedikit wang?

  • Tetapkan bajet anda dan tempoh masa
  • Rangkakan cadangan anda
  • Dibayar untuk kerja anda

Upah Freelancer yang juga membida projek ini

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online