title: Reference: What is variable scope, which variables are accessible from where and what are "undefined variable" errors?
body: <blockquote>
    <p>Note: This is a reference question for dealing with variable scope in PHP. Please close any of the many questions fitting this pattern as a duplicate of this one.</p>
  </blockquote>
  
  <p>What is "variable scope" in PHP? Are variables from one .php file accessible in another? Why do I sometimes get <em>"undefined variable"</em> errors?</p>