OK, I used to use php arrays for this until I started messing with GETTEXT. This means using .po files - MUCH easier than keeping arrays in synch.
Here's some recent blog posts I made on it (step by step):
http://diafol.blogspot.co.uk/2013/01/php-localization-with-gettext-on-windows.html
http://diafol.blogspot.co.uk/2013/01/creating-pot-files-in-poedit-for.html
http://diafol.blogspot.co.uk/2013/01/supporting-xgettext-on-windows-from.html
However, if you're not keen on that approach, constants can be a bit awkward, you're probably better off with arrays, but the idea's the same.
WRT flags - it's pretty, but it can be annoying. If I choose my default language, I wouln't want somebody else's flag up there to click. For example, who's flag do you give for English? French would be Canada? Or what about Canadian English? What about Switzerland? I suppose you can argue that your country codes *_FR or *_GB can justify their inclusion, but IMO, they're not worth it.
Also, you should always have a querystring (www.example.com?lang=fr) or better still a mod-rewrite for that: (www.example.com/fr/). This means that your SEO isn't confused as each url landing page should be unique. So avoid just keeping state with a session variable.
The www.example.com/fr/ does NOT mean subdirectories for every language - just in case you're not familiar with rewrites.
So if you want freanch as your default, you could do something like this:
<?php
session_start();
$defaultLang = 'fr';
$page = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);
//NO VALID LANG FROM URL
if(!isset($_GET['lang']) || !in_array($_GET['lang'], array('fr','en'))){
if(isset($_SESSION['lang'])){
$reloadLang = $_SESSION['lang'];
}elseif(isset($_COOKIE['lang'])){
$reloadLang = $_COOKIE['lang'];
}else{
$reloadLang = $defaultLang;
}
//RELOAD to a VALID url
header("Location: http://www.example.com/$reloadLang/$page/");
exit;
//VALID LANG FROM URL
}else{
$lang = $_GET['lang'];
//you could set a cookie here too if req'd
$_SESSION['lang'] = $lang;
}
//LOAD THE CORRECT LANGUAGE FILE
include("lang/$lang.php");
That should load all your strings for the page or site.
<div id="langs">
<a href="/fr/<?php echo $page;?>/">FR</a> | <a href="/en/<?php echo $page;?>/">EN</a> <?php echo WELCOME;?>
</div>
You could apply a class for the active link above too, so that it stands out, or even make it static text so that it can't be clicked (as it doesn't make sense to click the active language).