Question: I would like to add the magento website name to the top header beside the language switcher. 

```
Magento_Store/templates/switch/languages.phtml

```

I can get the id by using, 

```
echo $block->getCurrentWebsiteId();

```

How do I get the website name?

Answer: 
```
public function __construct(

        \Magento\Store\Model\Website $websiteModel
    ..........
)
{
    $this->_websiteModel = $websiteModel;
}

public function getWebsiteName($websiteId)
    {
        $collection = $this->_websiteModel->load($websiteId,'website_id');
        return $collection->getName();
    }

```
```
public function getWebsiteName($websiteId)
{  
   $collection = $this->_websiteCollectionFactory->create();
   $websiteData = $collection->addFieldToFilter('website_id',$websiteId);

   foreach($websiteData->getData() as $websiteName):
      $webName = $websiteName['name'];
   endforeach;

   return $webName;
}

```