johnsmith153 Posted October 3, 2008 Share Posted October 3, 2008 Rather than lots of if statements, how would it be best to covert a persons name into a number rank? Ie. Bob b=02 (2nd letter of alphabet) o=15 (15th etc.) b=02 bob=021502 (21502) I know this sounds crazy, but I also add other numbers to the front to decide how something should be ranked. Link to comment https://forums.phpfreaks.com/topic/126834-simple-convert-letter-to-number/ Share on other sites More sharing options...
trq Posted October 3, 2008 Share Posted October 3, 2008 <?php $a = array_flip(range('a','z')); echo $a['b']; ?> Link to comment https://forums.phpfreaks.com/topic/126834-simple-convert-letter-to-number/#findComment-656034 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.