PHP 8.3.27 Released!

Voting

: min(three, five)?
(Example: nine)

The Note You're Voting On

monkyNOSPAM at phpfi dot org dot invalid ΒΆ
23 years ago
Here's how to use bitwise operations for RGB2hex conversion. This function returns hexadesimal rgb value just like one submitted by gurke@bigfoot.com above.

function hexColor($color) {
return dechex(($color[0]<<16)|($color[1]<<8)|$color[2]);
}

example:

$col[0] = 25;
$col[1] = 255;
$col[2] = 55;

print hexColor($col);

<< Back to user notes page

To Top