title: How can i define a variable available to all php files(like superglobals)
body: <p>Is there a way to create/define a variable available to all php files(like superglobals)</p>
  
  <blockquote>
    <p>Example:</p>
    
    <p>i define a variable in <strong>file1.php</strong> <code>$car = ferrari</code></p>
    
    <p>then in <strong>file2.php</strong> i write <code>echo $car;</code></p>
    
    <p>then it will output <code>ferrari</code></p>
  </blockquote>
  
  <p>how can i define a variable in file1.php and access it in file2.php</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The answers is good, but do is there another alternative?because i will have multiple php files in multiple directories, do i have to create its own php file for each directory?if thats the only way, then i'll do it.</p>