Hi!
How can i read in only the filename (without the Filetyp) of a file?
thx
marce23
Show Filename without Filetype
Moderator: General Moderators
You always only get the filename. The filetype is a different variable in PHP.
If you're refering to the filetype-extension under Windows (e.g. myfile.txt), it's always three letters long and seperated by a dot. Hence you can can either use [php_man]substr[/php_man] and variants or [php_man]explode[/php_man].
If you're refering to the filetype-extension under Windows (e.g. myfile.txt), it's always three letters long and seperated by a dot. Hence you can can either use [php_man]substr[/php_man] and variants or [php_man]explode[/php_man].
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
It's not always three letters long. pathinfo() is a safer solution.
