PHP 8.1 tcpdf Call to undefined function each() in tcpdi.php

Viewed 13

I am trying to add a PDF page to an existing one using TCPDF. Since I had to update to PHP 8.1 this function won't work any longer as the each function has been deprecated. The code that breaks is as follows:

while (list($k, $v) = each($value[1])) {
    $this->_straightOut($k . ' ');
    $this->pdf_write_value($v);
}

Is there a way to rewrite this code?

0 Answers
Related