Date: 07/07/00
- Next message: Danny Tuppeny / Web Fever: "Re: [phplib] Chat client in PHP"
- Previous message: toby cabot: "Re: [phplib] Best use of User variables"
- In reply to: Jose Luis Rodríguez Sevilla: "[phplib] Extension of Files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
If it's just for gif and jpg then you can use GetImageSize(), it also tells you what type of image it is.
Nick
----- Original Message -----
From: Jose Luis Rodríguez Sevilla
To: phplib <email protected>
Sent: Friday, July 07, 2000 2:51 PM
Subject: [phplib] Extension of Files
I want to know if a file ($f) is an image file; i try to extract the extension (.gif or .jpg) of this file but i don't know how i can do it.
If you know how, tell me a part of code of this or an example.
if (isset($FILE)){
$f = $FILE;
if (filesize($f) < $max_file_size){
$complet_file = explode(".", $FILE);
$pos = count($complet_file);
$pos = $pos - 1;
$extension = $complet_file[$pos];
$ext = strtolower($extension);
if (($ext == "gif") || ($ext == "jpg")){
..........
}
Thank You.
- Next message: Danny Tuppeny / Web Fever: "Re: [phplib] Chat client in PHP"
- Previous message: toby cabot: "Re: [phplib] Best use of User variables"
- In reply to: Jose Luis Rodríguez Sevilla: "[phplib] Extension of Files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

