I have created an attribute with multiple options I have to get all option of in dropdown.
Attribute created: country Options: India, USA, UK
below is my code in phmtl file
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productCollection = $objectManager->get('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
$collection = $productCollection->create();
$collection->addAttributeToSelect('country')
->addAttributeToFilter('country', array('notnull' => true))// get only not null values
->getSelect()->group('country');
print_r($collection);
it does not show all attribute option of the country.