0

I have two tables displaying our judges info. One for English the other for French. The last column shows the judges judging division, M = masters, A = Advanced and so on. Only the the first letter is displayed. My db has only the English so I need to change the value to French equivalent.

The logic is like this:

$divStr = $row['JudgingLevel'];
if $divStr = "M" then $div = "E";
elseif $divStr = "A" then $div = "I" 
elseif $divStr = "S" then $div = "N";

echo $div;

What is the proper syntax for this?

1

1 Answer 1

1
echo $div = strtr($divStr = $row['JudgingLevel'], array(
    'M' => 'E',
    'A' => 'I',
    'S' => 'N',
));

^ in one strike!

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.