I am including a file called includes/db.php which in turn requires connection_details.php
The issue I am having is I must read the content of db.php with this following line.
$dbSettingsFile = realpath( dirname( __FILE__ ) )."\connection-details.txt";
$lines = file($dbSettingsFile);//file in to an array
But if I am in turn already including the db.php file from a file that is something like. /subfolder/file.php
with the line
require('../includes/db.php');
But this will always work on windows but am I right in saying because of the backward slash in the $dbSettingsFile variable it will not work in linux? I have to be very specific like this because if you removed the realpath and ran file.php it would not pick up the correct path.