note 86203 modified in function.is-numeric by felipe [email protected] Fri, 10 Oct 2008 12:32:17 -0700 Newsgroups php.notes Message-ID <[email protected]> "$e = (int) substr( $n , -2 );" What the heck am I thinking. <?php function number_suffix2($n) { $s = array( 1->'st' , 2=>'nd' , 3=>'rd' ); $e = $n % 100; $x = $n % 10; return $n.( ( $x > 0 && $x < 4 && ( $e < 11 || $e > 13 ) ) ? $s[$x] : 'th' ); } ?> --was-- "$e = (int) substr( $n , -2 );" What the heck am I thinking. function number_suffix2($n) { $s = array( 1->'st' , 2=>'nd' , 3=>'rd' ); $e = $n % 100; $x = $n % 10; return $n.( ( $x > 0 && $x < 4 && ( $e < 11 || $e > 13 ) ) ? $s[$x] : 'th' ); } http://php.net/manual/en/function.is-numeric.php