I have this code where I try to print out some users predictions for 48 games to a html table. It does what I wan't but some weird characters is coming up when the two foreach loops runs. The code can be viewed here. http://www.fotbolltipset.se/2020/test.php

That is some pretty bad code by the way. Best thing to do is post an SQL dump of your schema along with a few sample records and then tell us what you want to know from the data.

The XY Problem
The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.