I'd probably use an array, rather than a whole bunch of IFs:
$items = array(
'small' => array(
'red' => 1001,
'green' => 1002,
'blue' => 1003
),
'medium' => array(
'red' => 1011,
'green' => 1012,
'blue' => 1013
),
'large' => array(
'red' => 1021,
'green' => 1022,
'blue' => 1023
)
);
if(isset($items[$size][$color]))
{
$item_number = $items[$size][$color];
}
else
{
// handle error condition here
}
Of course, this would probably best be handled with putting that data in a database instead of in the code, then doing one pretty simple query to get the item number.