-1

I am using a 2008 php program to take an image, annotate it and create a thumbnail of the image.

The program works but throws a notice that the each function is deprecated, and the PHP docs say it will stop working in PHP 8.

Here is the line with the each

 while (list($numl, $line) = each($lines)) {

How do I get rid of the each?

Bill
  • 77
  • 1
  • 10

1 Answers1

1

Use foreach instead.

foreach ($lines as $num1 => $line) {
HTMHell
  • 5,761
  • 5
  • 37
  • 79