Skip to content
Advertisement

How to make a PHP variable accessible from every webpage?

Is it possible to create a variable, set its value through a webpage and make it accessible from code in other webpages?

If yes, how is this done in PHP?

Will the variable have a life time in memory if it is not used for a long time?

Advertisement

Answer

  1. Use session or cookie varibles (or)
  2. declare in common file (or)
  3. Try global variables (or)
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement