I'm using TCPDF plugin to generate the PDF in PHP 7. The same code is working fine in the lower version PHP 5 but when I run this same code in the PHP 7 it's giving the below error message.
A PHP Error was encountered
Severity: 8192
Message: The each() function is deprecated. This message will be suppressed on further calls
Filename: tcpdf/tcpdf.php
Line Number: 16542
Edit in File: \FPDI\fpdi.php
the Line 567:
//while (list($k, $v) = each($value[1])) {
in Code:
foreach ($value[1] AS $k => $v) {
And edit in File: \tcpdf\tcpdf.php
the Line 16543:
//while (list($id, $name) = each($attr_array[1])) {
in Code:
foreach($attr_array[1] as $id => $name) {
Note to anybody that finds this...the latest version of TCPDF has this fixed...so if you simply do an update you should be ok: https://github.com/tecnickcom/TCPDF
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With