title: How do you check if a file is in a certain directory using PHP?
body: <p>When accessing a file in PHP, it's possible to escape from the directory using ".." which can lead to a security risk. Is there any way to validate that a file is in a specified directory? There doesn't seem to be a built-in function for it.</p>