What potential issues or limitations should be considered when using file_exists or is_readable functions to check for file accessibility over a network in PHP?

When using file_exists or is_readable functions to check for file accessibility over a network in PHP, potential issues may arise due to network latency or permissions. To address these limitations, it is recommended to use alternative methods such as cURL to check for file accessibility over a network.

// Example using cURL to check for file accessibility over a network
$ch = curl_init('http://example.com/file.txt');
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    echo 'File is accessible over the network.';
} else {
    echo 'File is not accessible over the network.';
}