Jump to content

Recommended Posts

Hello Friends,

 

I've an function which has an array in arabic

now i want when lang goes english is shows me it but in english as follow

 

 

if lang=en  show function f1 and if lang=ar show function f2

 

 

below the code but indeed show error ( not in function but in closing if and if not ) can you please fix it !

 

if($lang == "en")

/////////////// function //////////
function career_level($c, $id) {
$levels = array("xxxxxxxx", "xxxxxxxxx");
if($id >= '0')
{
$level = $levels[$id];
return $level;
}
else
{
$select = "<select class='qc_textbox'name=\"careerlevel\">\n\t";
while(list($k,$v) = each($levels))
{
if($c >= '0')
{
if($c == $k)
{
$select .= "<option value=\"$k\" selected>$v</option>\n\t";
}
else
{
$select .= "<option value=\"$k\">$v</option>\n\t";
}
}
else
{
$select .= "<option value=\"$k\">$v</option>\n\t";
}
}
$select .= "</select>\n\n";
return $select;
}
}
//////////////////////////////////////////


else if($lang == "ar")


////////////////// same function //////////

function career_level($c, $id) {
$levels = array("xxxxxxxx", "xxxxxxxxx");
if($id >= '0')
{
$level = $levels[$id];
return $level;
}
else
{
$select = "<select class='qc_textbox'name=\"careerlevel\">\n\t";
while(list($k,$v) = each($levels))
{
if($c >= '0')
{
if($c == $k)
{
$select .= "<option value=\"$k\" selected>$v</option>\n\t";
}
else
{
$select .= "<option value=\"$k\">$v</option>\n\t";
}
}
else
{
$select .= "<option value=\"$k\">$v</option>\n\t";
}
}
$select .= "</select>\n\n";
return $select;
}
}


Link to comment
https://forums.phpfreaks.com/topic/176510-if-en-then-f1-and-if-ar-then-f2/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.