0

I'm using a PHP script for my HTML files. Actually, it worked before but when I migrate to a new server, it's getting this error:

Notice: Array to string conversion in /www/branch/docroot/.example//index.php on line 2387

I'm checking related lines but I cannot see any error.

'<td><a href="?id=' . $html_id . '" class="text-decoration-none">' . $subject . '</a></td>' .

Also, my page is working with this error. How can I solve it?

folec94
  • 13
  • 3
  • What is the content of `$html_id` and `$subject` ? – executable Feb 03 '22 at 12:57
  • 3
    One of the variables you're trying to output is an array. You can't echo arrays. Check what your variables contain. – M. Eriksson Feb 03 '22 at 12:57
  • Notice/warnings aren't errors so they will still compile. They just won't give what you want so notice/warning is given. `var_dump` the two variables and see what you have. – user3783243 Feb 03 '22 at 13:00
  • 1
    Does this answer your question? [Reference - What does this error mean in PHP?](https://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php#24507107) – M. Eriksson Feb 03 '22 at 13:04
  • `How can I solve it`...don't try to convert arrays to strings. Check the content of $html_id and $subject, because one of them is an array. Of course you can also just configure PHP to log the instead of putting it on the screen, if you prefer to pretend the problem does not exist. – ADyson Feb 03 '22 at 15:43

0 Answers0