Here's my situation:
I'm working on a PHP project that uses a few functions I have written to work with an external xml document. What I want to do is import the same functions.php
file into many different pages that all use the same code. The problem is that the path to the xml file isn't always the same, and is often dependent upon the view that is currently displayed.
What I am trying to do is basically declare a $source = 'path-relative-to-view';
in my view, before I include 'path-to-functions.php';
and then have the functions access the $source variable whenever necessary. In this way, I won't have to rewrite the functions for every different directory I am in.
I assume this is possible, but unfortunately, I haven't used PHP enough to know for sure.