title: Problem in FPDF header with a php variable
body: <p>I have a php file that I use to print pdf (using FPDF). In this file I have a variable $date and I would like to show this variable $date in the header on each of the pages of my pdf document.
  That is my variable $date:</p>
  
  <pre><code>$convert_date=strtotime($selected_date);
  global $date;
  $date=date("d/m/Y",$convert_date);
  </code></pre>
  
  <p>And this is the class FPDF:</p>
  
  <pre><code>class PDF extends FPDF{
  
      function setDate($dat){
          $this-&gt;header_date = $dat;
      }
  
      function getDate(){
          return $this-&gt;header_date;
      }
  
      function Header(){
          $this-&gt;SetFont('Arial','B',16);
          $this-&gt;setDate($date);
          $this-&gt;Write (10, '       Date: '); //1° Write
          $this-&gt;Write (10, $this-&gt;getDate()); //2° Write NOT WORKING 
          $this-&gt;Ln();
      } ...
  </code></pre>
  
  <p>The problem is that the second $this->Write prints nothing.</p>
  
  <p>I checked that if I call <strong>$this->setDate('abcd');</strong>, it prints "abcd" ok.</p>
  
  <p><strong>How can I pass this $date variable in my pdf header function?</strong></p>