View Single Post
Old 12-20-2007, 01:52 AM   #1 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default Having trouble with Custom Function "isImage"

PHP Code:
<?php

 
function isImage($handler) {
    if(
file_exists($handler)) {
        
$handler == $handler.".JPG";
        
$handler == $handler.".PNG";
        
$handler == $handler.".GIF";
        
$handler == $handler.".BMP";
 }
}

$handler "test.bmp";

 if(
isImage($handler)) {
     echo 
"$handler is in fact, an Image!";
} else 
   echo 
"$handler is not an Image!";

   

?>
It outputs $handler is not an Image when really it is!

What is the problem here!

One more thing, is it case sensitive?
Orc is offline  
Reply With Quote