Hi Christopher,

This depends a bit on how your code is structured, and particularly how the different folders are related. One option would be to use a configuration variable to specify where the file(s) are located. Another one would be something like this:

$dir = realpath(__DIR__ . '/../track/data/this.dat');

My preference is to use a configuration variable when the data is from a separate source, and the __DIR__ method when it's part of the same source tree, because in that case you can be fairly sure that the relative structure will remain the same between deployments.

Hope that helps!

CAPTCHA