title: How to declare a global variable in php?
body: <p>I have code something like this:</p>
  
  <pre><code>&lt;?
      $a="localhost";
      function body(){
          global $a;
          echo $a;
      }
  
      function head(){
          global $a;
          echo $a;
      }
  
      function footer(){
          global $a;
          echo $a;
      }
  ?&gt;
  </code></pre>
  
  <p>is there any way to define the global variable in one place and make the variable <code>$a</code> accessible in all the functions at once? without making use of <code>global $a;</code> more?</p>