Not sure what you mean by "not getting"?
One thing that's important to understand is that url's involve "web space", not filesystem space on a workstation.
If you use FILE|OPEN with your browser, the browser goes into a local mode where it will parse html etc, and will work with local files and paths but rarely do I see this use case. Since I'm not sure what the purpose of your current scripts are, it's hard to say, but a URL is not a filesystem path.
Is this code meant to be accessed via a browser? Then your URL's need to be within webspace, and not reflecting a file system path.
Just for clarity, even with what you have, it's odd, and you introduce a space where you probably need a directory separator. If you are using interpolation, then use it.
Maybe?
echo "<a href='$latest_dir/$latest_file'><button>continue</button></a><br>";
With that said, this should only produce a url with a local filesystem path, and only usable by a browser in local mode, which is almost never what you want to be using PHP for.