Is there a way in PHP to use the define function from another file in another directory in your PHP code?
For example my code is in this directory /home/dirA/dirB/dirC/
the the define function was from the directory /home/dirA/
define('KEYWORD',boi);
how can i use it in my code so that if I echo KEYWORD, it will display boi
without putting the define function in my code.
thank you guys for your help
define function from other files
Moderator: General Moderators
Take a look at http://de2.php.net/manual/en/function.require.php
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
I already figured it outthanks for the reply guys,
additional question how can I include a file from a different directory?
I use include_path='.:/var/www/html/dir1';
but it doesn't seem to work or it is not what I need
just to share, I use include("/dir/somefile.txt");