To return value of a char . For example , 2 is returned for '2' . 10 is returned for ' A ' , 11 for ' B '
< ? php function val ( $ c ) { if ( $ c >= '0' && $ c <= '9' ) return ord ( $ c ) - ord ( '0' ) ; else return ord ( $ c ) - ord ( ' A ' ) + 10 ; }