Transform array to png in php
I was wondering how i could transform an array of colors to a png image file.
the array is called `$pixels`.
Please help me.

    $im = imagecreatefrompng('start.png');
    $background = imagecreatefrompng('background.png');
    imageconverttruecolor($background);
    imageconverttruecolor($im);
    define('x',imagesx($im));
    define('y',imagesy($im));
    $pixels=array();
    for ($x = 0; x>$x;++$x){
	for ($y=0;y>$y;++$y){
		$s=imagecolorat($background,$x,$y);
		if ($s&&$s==imagecolorat($im,$x,$y))
		$pixels[$x][$y]=0xFFFFFF;
		else $pixels[$x][$y]=0x000000;
	}
    }
Transform array to png in php
===

I was wondering how i could transform an array of colors to a png image file.
the array is called `$pixels`.
Please help me.

    $im = imagecreatefrompng('start.png');
    $background = imagecreatefrompng('background.png');
    imageconverttruecolor($background);
    imageconverttruecolor($im);
    define('x',imagesx($im));
    define('y',imagesy($im));
    $pixels=array();
    for ($x = 0; x>$x;++$x){
	for ($y=0;y>$y;++$y){
		$s=imagecolorat($background,$x,$y);
		if ($s&&$s==imagecolorat($im,$x,$y))
		$pixels[$x][$y]=0xFFFFFF;
		else $pixels[$x][$y]=0x000000;
	}
    }