The code to check if the file exists is correct, so I am going to say that your path to the file that you're using is wrong.
This $_SERVER['DOCUMENT_ROOT'] is going to be the root directory for your hosted files. Unless the file exists in there (example: /home/public_html/) then this will fail. If the file is in the same directory that you're running this code above from, then you just need to put in the file name.
I get this:
string 'C:/www/ci/clientportal//www/ci/clientportal/index.php' (length=53)
So looks glob may not be what you are looking for. What is your goal you are trying to reach? Are you looking to find in an images exists within a directory? If so you could scan the directory and look for file's with .png, .jpg, .jpeg file extentions. PHP has other functions to read dir.