how to solve this error which is occured while coding a php invoice?

61 Views Asked by At

This is the error Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in C:\xampp\htdocs\fpdf17\fpdf.php:526 Stack trace: #0 C:\xampp\htdocs\fpdf17\fpdf.php(526): in_array('helvetica', NULL) #1 C:\xampp\htdocs\Invoice.php(13): FPDF->SetFont('helvetica', 'B', 14) #2 {main} thrown in C:\xampp\htdocs\fpdf17\fpdf.php on line 526 how the resolve the error in this code

// Font path
    if(defined('FPDF_FONTPATH'))
    {
        $this->fontpath = FPDF_FONTPATH;
        if(substr($this->fontpath,-1)!='/' && substr($this->fontpath,-1)!='\\')
            $this->fontpath .= '/';
    }
    elseif(is_dir(dirname(__FILE__).'/font'))
        $this->fontpath = dirname(__FILE__).'/font/';
    else
        $this->fontpath = '';

expecting the correct solution of this segment...

0

There are 0 best solutions below