global array?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is there any ways to have global variable that is array?

I defined a global variable in my text.php

*my test script
global $arrMyList;

//everyone goes through this function
function main(){
   global $arrMyList = array( "test"=>"This is just test", "submit" => "I am
submitting this varaible");

function myfunction2(){
    global $arrMyList;
    foreach($arrMyList as $list){
        echo $list;

but when goes to function2 $arrMyList is null

Re: global array?

.oO(s k2999999)

Quoted text here. Click to load it

If you fix the parse error, the typo (PHP will show you both) and call
main() somewhere, it will work.


Site Timeline