Jump to content

define function from other files


Ju-Pao

Recommended Posts

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                   

Link to comment
https://forums.phpfreaks.com/topic/39452-define-function-from-other-files/
Share on other sites

What you need to incorporate here is classes, you can have all your defined functions stored in a few scripts/directories then call them at will.  It's too big a topic to explain in one forum post, so what I suggest is that you look for a few tutorials / explanations on the net good luck ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.