title: Can I share variables between different functions in PHP?
body: <p>I'll try to explain with an example...</p>
  
  <p>Let's say I have two different functions, and one of them has a defined variable. In the second function, I don't wanna write the same variable again, can I simply use the variable from the first function in the second one WITHOUT redefining it in the second function?</p>
  
  <p>Something like:</p>
  
  <pre><code>function a()
  {
    $var = "my variable";
  }
  
  function b()
  {
   echo $var;
  }
  </code></pre>
  
  <p>Sorry if this questions is a bit silly, but I'm still a beginner =).</p>