php字母转成数字,php字母和数字互转。
function charToNum($string) { $char = 'abcdefghijklmnopqrstuvwxyz'; $char = chunk_split($char, 1, ','); $char = explode(',', $char); return is_numeric($string) ? $char[$string] : array_flip($char)[$string]; }