<? $bg = "0xFF 0xFF 0xFF"; $bcg = explode(" ", $bg); $bg = imagecolorallocate($im, $bcg[0], $bcg[1], $bcg[2]); ?> What's wrong? I'm getting default black color instead of needed white. When putting 0xFF directly everything works fine.
well i dont see definate advantage of coding that way ... any way for now,seems like explode is not taking space in proper way... whats about using - hypen and using pr to see what array $bcg has before send it to function
You might be better off creating your own function. You could then send it "FFFFFF", then split it every 2 characters, and add "0x" to the start. By the way, imagecolorallocate does not set the background colour, it only sets a color resource. You would set the background colour by referencing the $bg variable in imagefill. imagefill($im, 0, 0, $bg); Code (markup): Try using var_export($bcg); to see what is is the array.