function strip_ext($name)
        {
                $ext = strrchr($name, '.');
                if($ext !== false)
                {
                        $name = substr($name, 0, -strlen($ext));
                }
                return $name;
        }
        // demonstration
        $filename = 'file_name.txt';
        echo strip_ext($filename)."n";
        // to get the file extension, do
        echo end(explode('.',$filename))."n";
1 Temmuz 2007 Pazar
How to strip file extension
  Subscribe to:
  
Kayıt Yorumları (Atom)
0 Comments:
Post a Comment