Access environment information in template
In Craft 3 you can get the env using the getenv() function:
{% set env = getenv('ENVIRONMENT') %}

{% if env == 'dev' %}
    hello dev
{% else %}
    hello world
{% endif %}

Or via the app’s config service:
{% set env = craft.app.config.env %}

There's a bit more information about the .env file in the docs for Environmental Configuration.