Hi folks,

Let's say that I have 2 constants

DEFINE('DESKTOP_URL_en', "http://www.website.com/index.php?page=home";);         
DEFINE('DESKTOP_URL_fr', "http://www.website.com/index.php?page=accueil";);      
        

and I would like to populate the value of an href with them depending
on the user's language.  $_SESSION['lang'] is either 'en' or 'fr'.
How would I go about referring to this variable?

I have tried:

${'DESKTOP_URL_'.$_SESSION['lang']};
${DESKTOP_URL'.'_'.$_SESSION['lang']};
{DESKTOP_URL'.'_'.$_SESSION['lang']};
etc, to no avail.

If it is a regular variable I'm fine, it's the CONSTANT_FORMAT that
seems to be causing my brain some issues.

Thanks,
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to