Loading ...
Sorry, an error occurred while loading the content.

Doubt regarding multiple file inclusions

Expand Messages
  • Ajitabh Pandey
    Hi, Please help clear the following doubt: (1.) I have a config.php file having a variable $language set to a particular value. Using the require_once or
    Message 1 of 2 , Oct 8, 2002
    • 0 Attachment
      Hi,

      Please help clear the following doubt:

      (1.) I have a config.php file having a variable
      $language set to a particular value.
      Using the require_once or require statement I am
      including this file in index.php.
      Within index.php I have a function which makes use of
      the variable $language. Without passing $language as a
      parameter to the function, I want to use it within the
      function (sort of global variable) how do I do that?

      (2.) What is the difference between
      require/require_once and include statements?


      Regards.
      Ajitabh Pandey


      __________________________________________________
      Do you Yahoo!?
      Faith Hill - Exclusive Performances, Videos & More
      http://faith.yahoo.com
    • Dr Tarique Sani
      ... Like you said use the global declaration function blah () { global $language } ... Read the manual :-) HTH Tarique --
      Message 2 of 2 , Oct 8, 2002
      • 0 Attachment
        On Tue, 8 Oct 2002, Ajitabh Pandey wrote:

        > the variable $language. Without passing $language as a
        > parameter to the function, I want to use it within the
        > function (sort of global variable) how do I do that?

        Like you said use the global declaration

        function blah () {
        global $language

        }


        > (2.) What is the difference between
        > require/require_once and include statements?

        Read the manual :-)

        HTH

        Tarique

        --
        =============================================================
        PHP Applications for E-Biz: http://www.sanisoft.com

        Indian PHP User Group: http://groups.yahoo.com/group/in-phpug
        =============================================================
      Your message has been successfully submitted and would be delivered to recipients shortly.