I have a call from PHP to a function, but it stops after the first run.
while ($rowfight = $resultfights->fetch_assoc()) {
// ..
merge($file1, $file2, $filename_result, $rowfight['team1Name'], $rowfight['team2Name'], $rowfight['description'], '' );
// ..
}
function merge($filename_x, $filename_y, $filename_result, $team1, $team2, $battle, $winner ) {
// Do some stuff with image here
// ..
header('Content-Type: image/png');
header('Content-Disposition: attachment; filename='.basename($filename_result));
imagepng($image);
// ..
}
It downloads the first .png
image, and then stops.
What to do?
(I know it's something with the headers but I can't find out what)