Better rely on http://fr2.php.net/pathinfo to extract extension