How to detect for Mobile device Programmatically in Magento 2?

In Magento 2 you can detect mobile device by below code snippets.

Sometimes you need to display different data on mobile device specific or hide some data from the Mobile device at that time you have useful below code snippet.


How to check module is enable or not programmatically in Magento 2?

In Magento We can check any module is enable or disable using simple code snippet. Call Magento\Framework\Module\Manager class to__construct() for check module status.

Call from template,

$isEnable = $block->isModuleEnable();