first off....php noob...enough said
I created this function to build the items to go in a list:
The "get_text" call does return a value. I checked. But when I call this function like this:Code:function get_lang_menu() { $lang = get_text("en", "ja", "zh", "de"); $temp = ''; if ($lang=="en") { $temp += '<li>English</li>'; } else { $temp += '<li><a href="../index.php?lang=en">English</a></li>'; } if ($lang=="ja") { $temp += '<li>Japanese</li>'; } else { $temp += '<li><a href="../index.php?lang=ja">Japanese</a></li>'; } if ($lang=="zh") { $temp += '<li>Chinese</li>'; } else { $temp += '<li><a href="../index.php?lang=zh">Chinese</a></li>'; } if ($lang=="de") { $temp += '<li>German</li>'; } else { $temp += '<li><a href="../index.php?lang=zh">German</a></li>'; } return $temp; //return '<li><a href="../index.php?lang=en">English</a></li><li><a href="../index.php?lang=ja">Japanese</a></li><li><a href="../index.php?lang=zh">Chinese</a></li><li><a href="../index.php?lang=de">German</a></li>'; }, a 0 get printed out.Code:<?php echo(get_lang_menu()) ?>
If i switch out the last two return lines (comment out one) it works fine with the second hard coded string.
So I assume my if statement is not what it should be.......right?




Reply With Quote