What is the significance of providing the complete path when using is_dir in PHP?

When using the is_dir function in PHP, it is important to provide the complete path to the directory you are checking. This is because is_dir expects a full path to the directory, not a relative path. Providing only a relative path may lead to unexpected results or errors.

$directory = '/full/path/to/directory';

if(is_dir($directory)){
    echo 'The directory exists.';
} else {
    echo 'The directory does not exist.';
}