title: Fatal Error: Call to undefined method FPDF
body: <p>I got this error message. Please help me solve that.</p>
  
  <p><strong>Fatal error: Call to undefined method FPDF::check() in C:\xampp\htdocs\sikembul\application\views\viw_slip_gaji.php on line 38</strong></p>
  
  <p>this my code</p>
  
  <pre><code>&lt;?php
  $GLOBALS['a']=2;
  $GLOBALS['alpha']=3;
  $GLOBALS['beta']=5;
  
  
  function check($num)
  {
      if ($num=="1")
      {
          global $a;
          global $alpha;
          global $beta;
  
          $total = $a*$alpha*$beta;
          $this-&gt;fpdf-&gt;Cell(50,5,'final',1,0,'L');
          $this-&gt;fpdf-&gt;Cell(8,5,'xx.',1,0,'L');
          $this-&gt;fpdf-&gt;Cell(20,5,$total,1,1,'R');
      }
      else 
      {
          global $a;
          global $alpha;
          global $beta;
  
          $total = $a-$alpha-$beta;
          $this-&gt;fpdf-&gt;Cell(50,5,'final',1,0,'L');
          $this-&gt;fpdf-&gt;Cell(8,5,'xx.',1,0,'L');
          $this-&gt;fpdf-&gt;Cell(20,5,$total,1,1,'R');
      }
  }
  
  $this-&gt;fpdf-&gt;FPDF('P','mm','A5');
  $this-&gt;fpdf-&gt;SetMargins(10,10,10);
  $this-&gt;fpdf-&gt;AddPage();
  $this-&gt;fpdf-&gt;setFont('Times','B',9);
  $this-&gt;fpdf-&gt;Cell(130,5,'Here Some Text to Display',0,1,'C');
  $this-&gt;fpdf-&gt;check(1);
  
  $this-&gt;fpdf-&gt;Output('generate.pdf','I');
  ?&gt;
  </code></pre>
  
  <p>FYI, everything works fine when i disable the function. 
  Thanks for all of the help and comments. </p>