do not use file_exists(), if $A will == '' and the directory exist, it will return true.
instead use is_file();
example
<?php
// if you need to go back one folder use dirname(dirname(__FILE__))
// same like ../
$dir = dirname(__FILE__).'/test/'; // dirname(__FILE__) returns the absolute path for the file this is written in
$a = 'BOB';
$b = $dir.$a;
if(is_file($b))
{
// do something...
}
else
{
// do nothing...
}
?>
is_file() will also make sure it is a file, and not a symbolic link or a folder, but an actual file