To get the current running website id. All the Magento web developers may need to write this code while developing a Magento website in one way or another.
//Will return as integer
$website_id = Mage::app()->getWebsite()->getId();
//Will return as us,en,ae
$websitecode = Mage::app()->getWebsite()->getCode();
Find instructions here to download Magento 2 and install.