Make it global or pass it as an argument:

  function CurrentLang(){
    global $HTTP_SESSION_VARS;
    $language = $HTTP_SESSION_VARS["LangID"];
    echo($language);
  }

Or:


  function CurrentLang($HTTP_SESSION_VARS){
    $language = $HTTP_SESSION_VARS["LangID"];
    echo($language);
  }

--

Julio Nobrega

No matter where you go, &this.

"Wim Van Houts" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Somebody knows why I cannot reach the $HTTP_SESSION_VARS in a function
....
>
> For example, why does this not output the "en-US" string three times:
>
> <?
>   session_register("LangID");
>   $HTTP_SESSION_VARS["LangID"] = "en-US";
>   echo($HTTP_SESSION_VARS["LangID"]);
>   echo("**");
>   function CurrentLang(){
>     $language = $HTTP_SESSION_VARS["LangID"];
>     echo($language);
>   }
>   CurrentLang();
>   echo("**");
>   echo($HTTP_SESSION_VARS["LangID"]);
>
> ?>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to