Jump to content

[SOLVED] Where is that Extension type?


NorthWestSimulations

Recommended Posts

I know it has to be in the $_FILES["file"]['']; array somewhere. I just cant find it.

 

Lets say I upload a file named "test.wav" How do I get just the part of "wav" or if someone uploads a file like "Walalal.Test.haha.BooYeah.txt" it will take "txt" as the extension type. Hmm... Im curious, Any ideas how I get this info?  ???

Link to comment
https://forums.phpfreaks.com/topic/143090-solved-where-is-that-extension-type/
Share on other sites

<?php
$path_parts = pathinfo('/www/htdocs/index.html');

echo $path_parts['dirname'], "\n";
echo $path_parts['basename'], "\n";
echo $path_parts['extension'], "\n";
echo $path_parts['filename'], "\n"; // since PHP 5.2.0
?> 

 

 

from php.net/pathinfo

 

or try

 

http://php.about.com/od/finishedphp1/qt/file_ext_PHP.htm

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.