<?php
function hex2rgb($hex = '') {
    $hex = substr($hex, 0, 1) == '#' ? substr($hex, 1) : $hex;

    $rgb = array();
    for ($i = 0; $i < 6; $i += 2) {
        $rgb[] = hexdec(substr($hex, $i, 2)) ;
    }
    return 'rgb(' . implode(', ', $rgb) . ')';
}

// Voorbeeld:
echo hex2rgb('#4B3D32'); // Zal "rgb(75, 61, 50)" outputten 
?>