title: access outside array variable inside class
body: <p>I have an array. but I don't know how to access it inside a class.</p>
  
  <p>below is my sample code.</p>
  
  <pre><code>&lt;?php
  
  $value[0]=11;
  $value[1]=22;
  $value[2]=33;
  
  class test {
      var $code1,$code2,$code3;
  
      function __construct() {
              $this-&gt;$code1 = $value[0];
              $this-&gt;$code2 = $value[1];
              $this-&gt;$code3 = $value[2];
              echo $code1;
          }
  }
  </code></pre>