Results 1 to 9 of 9

Thread: funciton returs 0

Threaded View

  1. #1

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Resolved funciton returs 0

    first off....php noob...enough said
    I created this function to build the items to go in a list:
    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>';
      }
    The "get_text" call does return a value. I checked. But when I call this function like this:
    Code:
    <?php echo(get_lang_menu()) ?>
    , a 0 get printed out.
    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?
    Last edited by StrangerInBeijing; May 22nd, 2007 at 03:06 AM. Reason: Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width