Re: cannot access inc files from a function
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: cannot access inc files from a function

From: <bettina@coaster.ch>
Date: Fri Jul 29 2005 - 16:32:37 CEST

How should I define the global variable inside this function? What must
be global is the lang.{$lang}.inc.php so that it can be read inside the
function, isn't it?. I tried including the lang file in the function
but I receive an error.

require("lang.{$lang}.inc.php");
function technique($t) {
        switch ($t) {
                case 'C':
                    echo $charcoal;
                         break;
                case 'O':
                          echo $oil;
                           break;
                case 'A':
                           echo $acrylic;
                           break;
        }
}

<? technique($myTechnik ?>
Received on Mon Oct 24 02:09:07 2005