<?php


function sendEmail($to, $msg) {
	echo "$msg $to\n";
}



$skus = [
	'1234',
	'2341',
	'43253',
	'82344',
	'0001',
];
	
$dept = [
	2 => '2@email.com',
	3 => '3@email.com',
	4 => '4@email.com',
];
	
	
foreach($skus as $sku) {
	$digit = substr($sku, 0,1);
	if(array_key_exists($digit, $dept)) {
		sendEmail($dept[$digit], 'Send fulfillment order to ');	
	}
	else {
		sendEmail('general@email.com', 'No specific department handles this. Send it to the general email.');
}	}