<?php

$number = "44777777";

// Add your loop here to check for 3, 2, 1 digit
$we = substr($number, 0, 3);

$countrys = array(
    '1' => 'us',
    '2' => 'uk',
    '3' => 'de',
    '44' => 'fi',
    '123' => 'no'
);

$array = "$we"; // You don't need this

if (array_key_exists ($we, $countrys))
{
    // Remember to break out of your loop when the country is found
    $country = $countrys[$we];
}
else
{
    $country = "Non in list";
}
// End your loop here

echo "${we} is ${country}\n";