dewcansam is right, however for PHP<5 you'll have to convert all strings to the same case and test:
$fields[1] = "fedEX";
if (strpos(strtoupper($fields[1]),'UPS') !== false)
{
$shipper = "2";
}
elseif(strpos(strtoupper($fields[1]),'FED') !== false)
{
$shipper = "37";
} else {
$shipper = "6";
}