title: I can see the array outside function, but no inside the function, how pass variable inside function?
body: <p>Sorry for english, not my native language.</p>
  
  <p>I am trying to pass an array into a function. This array contains the three months of a determinate trimester. This code is about FPDF, I am doing a PDF report.</p>
  
  <p>This is the code: </p>
  
  <pre><code>&lt;?php
  include('../../../libreria/engine.php');
  
  require_once('../fpdf.php');
  
  $mes = $_GET["txtMes"];
  $per = $_GET["txtPer"];
  
  $_SESSION["tmpMes"] = $_SESSION["sqlDataPDF"]["titulo"];
  
  $sql =  $_SESSION["sqlDataPDF"]["textoSQL"];
  $mes = $_SESSION["sqlDataPDF"]["meses"];
  
  
  echo $mes[0];
  
  $rs = mysql_query($sql);
  
  class Anexo03 extends FPDF
  {
  
  
      var $ProcessingTable;   //Es la propiedad que indica si se esta procesando la tabla, para repetir nuevamente el encabezado.
      var $anchos;       // Son los anchos de las diferentes columnas
      var $left;        //Margen izquierdo inicial
      var $clasificador;
  
  
  
      function Header()
      {                        //0   1    2   3   4
          $this-&gt;anchos = array(100, 20, 30);
          $this-&gt;left = 15;
          $this-&gt;ProcessingTable = true;
          //Print the table header if necessary
  
      }
  
      function TableHeader($clasificador='x', $y=38, $c=false)
      {       
  
  
  
  
  
          if($c)
          {
              $clasificador = $this-&gt;clasificador;
          }
  
          $this-&gt;clasificador = $clasificador;
          $alto = 6;   //Es el alto de la linea
          $this-&gt;SetFillColor(209,211,223);
  
          $this-&gt;SetFont('Arial','',10);
          $this-&gt;SetXY($this-&gt;left,$y);
          $ancho = $this-&gt;anchos[0] + $this-&gt;anchos[1] + $this-&gt;anchos[2] + $this-&gt;anchos[3];
          //$this-&gt;Cell($ancho,$alto,"Clasificador: $clasificador", 'LRT',0,'L',1);
  
          //$this-&gt;SetXY($this-&gt;left,$y+4);
          $this-&gt;Cell($this-&gt;anchos[0],$alto,"Clasificador", 'LBT',0,'C',1);
          $this-&gt;Cell($this-&gt;anchos[1],$alto,'$mes[0]', 'RBT',0,'C',1);
          $this-&gt;Cell($this-&gt;anchos[1],$alto,'$mes[1]', 'RBT',0,'C',1);
          $this-&gt;Cell($this-&gt;anchos[1],$alto,'$mes[2]', 'RBT',0,'C',1);
          $this-&gt;Cell($this-&gt;anchos[2],$alto,"Total Trimestral", 'RBT',0,'C',1);
  
  
      }
  </code></pre>
  
  <p>This code is receiving the array. I can echo the variable <code>$mes</code> without problem, I can see the data, the problem comes when I put inside <code>function TableHeader</code>. I try to <code>var_dump</code> and <code>echo</code> the variable <code>$mes</code> but <code>var_dump</code> give me null and <code>echo</code> doesnt do nothing. Is like the data is missing when I put the array inside the function.</p>
  
  <p>I was trying different ways to pass the variable <code>$mes</code> inside function, maybe I didnt do good.</p>
  
  <p>What do you think can I do?</p>