Results 1 to 7 of 7
Sep 30, 2012, 09:34 #1
- Join Date
- Aug 2010
- 2 Post(s)
- 0 Thread(s)
Using a Constant with a Function?
I have a "config" file where I define...
// Base URL (**Virtual Location) define('BASE_URL', ENVIRONMENT === 'development' ? 'http://local.debbie' : 'http://www.MySite.com');
However, now I want to incorporate it into a Function that I am working on, and I'm not sure how its scope works?!
Here is my current Function...
$url = 'http://local.debbie/' . $section . '/articles/';
What do I need to do to replace that static URL with reference to my Constant so that when I switch between "Development" and "Production", everything still works"
Can my Constant - defined in my "config" file - be seen INSIDE my Function? (Or do I need to pass it into the Function? Or something else?)