- a3d2i2
- i'm a great whale
- Offline
- Registered: 2008-06-15
- Posts: 10
Topic: read file extension
$ftmp = $_FILES['image']['tmp_name'];
$oname = $_FILES['image']['name'];
$oname = str_replace(" ","_",$oname);
$oname = str_replace("%20","",$oname);
$fname = $uploaddir.$oname;
$fileInfo = pathinfo($fname);
$extension = strtolower($fileInfo["extension"]);
// do your work here... :)
so you can just use the $extension to make more condition...
Warning: Undefined variable $pattern_callback in
/var/www/vhosts/ctw/include/parser.php on line
820
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/vhosts/ctw/include/parser.php:820
Stack trace:
#0 /var/www/vhosts/ctw/include/parser.php(1037): do_bbcode()
#1 /var/www/vhosts/ctw/viewtopic.php(532): parse_signature()
#2 {main}
thrown in
/var/www/vhosts/ctw/include/parser.php on line
820