Come posso scrivere una funzione che mi dà il numero del carattere che viene passato ad essoPHP funzione per ottenere carattere Numero
Ad esempio, se il nome funciton è GetCharacterNumber
e passo B
ad esso allora dovrebbe dare mi 2
GetCharacterNumber("A") // should print 1
GetCharacterNumber("C") // should print 3
GetCharacterNumber("Z") // should print 26
GetCharacterNumber("AA") // should print 27
GetCharacterNumber("AA") // should print 27
GetCharacterNumber("AC") // should print 29
E 'anche possibile per raggiungere questo obiettivo?
È un ordine personalizzato? Hai un tavolo con tutti i valori possibili? – Deleteman
Vuoi che restituisca valori per "AAA", "AAHJSNDJS" ecc.? –
Cosa restituire 'BA'? – h2ooooooo