Check path of file

realpath() function

<?php
$file_path = 'example.txt';

$real_path = realpath($file_path);

if ($real_path !== false) {
    echo "The real path of the file is: $real_path";
} else {
    echo "The file path does not exist or is not accessible.";
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *