The documentation describes this feature:

resource imagerotate ( resource $image , float $angle , int $bgd_color [, int ignore_transparent = 0 ] ) 

bgd_color Background color of the free zone after rotation.

How to translate white color into int?

    1 answer 1

    0xffffff - white

    for other colors you can use the function:

     function createcolor($r, $g, $b) { return hexdec(str_pad(dechex($r), 2, 0, STR_PAD_LEFT).str_pad(dechex($g), 2, 0, STR_PAD_LEFT).str_pad(dechex($b), 2, 0, STR_PAD_LEFT)); } 

    $ r, $ g, $ b respectively red, green, blue from 0 to 255