I have a sql table. It's name is content.PHP Code:function selectLanguage($c)
{
global $l; // Get language code from url via $_GET method
if (($l) AND (($l == 'en') OR ($l == 'de')))
{
if ($l == 'en')
{
return $c;
}
if ($l == 'de')
{
return $c.'_l1';
}
}
else
{
return $c;
}
}
In content table, i have 2 rows. These are content_main and content_main_l1.
The rows are have same content. content_main is in english. content_main_l1 is in german.
My links are like;
xxx.com/en/content
xxx.com/de/content
I want, if url contains en, the function returns content_main and if url contains de the function return content_main_l1.
I use the function like above. But the output is like;PHP Code:echo selectLanguage($content->content_main); // I use ezsql class so i write row name like $content->content main
$content->content_main_l1 or $content->content_main
OR
if i use quote or double quote the output is like;
contentOfRow_lr or contentOfRow
So how can i run this function correct.


Reply With Quote
Bookmarks