Hoi,

Ik gebruik fpdf en in fpdf.php staat het volgende:

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

In de errorlog zie ik dat each deprecated is, hoe kan ik dit stukje van het script zo aanpassen dat alles weer werkt?
Je kan prima een [php]foreach[/php] gebruiken op $value[1]

<?php
foreach($value[1] as $k => $v)) {
$this->_straightOut($k . ' ');
$this->pdf_write_value($v);
}
?>

Misschien is het handig om deze wijziging ook door te geven aan de makers, of als ze een GitHub'je hebben om dit te pushen. Ze zullen je dankbaar zijn..... :-)
The latest version requires at least PHP 5.1 and is compatible with PHP 7.4.
Misschien is er een update te vinden op http://www.fpdf.org/
Ik gebruikte deze vroeger ook, is prima tool.
Bedankt voor de tip.
Er is inderdaad een update, zal die gaan installeren.
Add this to your wp-config.php file:

error_reporting(E_ALL & ~E_DEPRECATED);

This will suppress the 'Deprecated' warnings from PHP. However, the each() function will be completely gone when PHP v8.0 becomes mainstream, and this code will completely break unless it's updated by the author.
** knip**


Herminiofd Mills op 28/08/2021 12:00:07

Add this to your wp-config.php file:

error_reporting(E_ALL & ~E_DEPRECATED);

This will suppress the 'Deprecated' warnings from PHP. However, the each() function will be completely gone when PHP v8.0 becomes mainstream, and this code will completely break unless it's updated by the author.


Slecht idee! Als php8 op de server geinstalleerd staat dan krijg je misschien weeer een melding want dan werk each totaal niet meer.

PS de taal hier is Nederlands
SPAM!

puur een post om de link naar die site te kunnen posten.
Ivo P op 30/08/2021 22:14:57

SPAM!

puur een post om de link naar die site te kunnen posten.

En schijnheilig na een edit.
Yegh!

Reageren