Q:

Magento 1.9 Get website code by SKU

I have a Magento 1.9 site that I have created 4 websites (UK, USA, etc..) in admin.
I have products added to only a certain website.
How can I get website code by product SKU programmatically? So I can see which website that a product is associated to?
Is it possible with product model?
$products = Mage::getModel('catalog/product')

A:

$_product = Mage::getModel('catalog/product')->load(10); //10 is product id
$websiteIds = $_product->getWebsiteIds();
foreach($websiteIds as $websiteId){
    echo Mage::getModel('core/website')->load($websiteId)->getData("code").'<br/>';
}

