Liquid Fire Posted November 10, 2006 Share Posted November 10, 2006 Is there anyway of declearing a array as global? Link to comment https://forums.phpfreaks.com/topic/26800-global-array/ Share on other sites More sharing options...
hostfreak Posted November 10, 2006 Share Posted November 10, 2006 $array = array ();$array = $GLOBALS["array"];Do you mean like that? Link to comment https://forums.phpfreaks.com/topic/26800-global-array/#findComment-122565 Share on other sites More sharing options...
Liquid Fire Posted November 10, 2006 Author Share Posted November 10, 2006 I want to be able to access my array in a function and can't right now because of the scope with the array not being decleared in the function and i don't want to pass in though the parameters. Link to comment https://forums.phpfreaks.com/topic/26800-global-array/#findComment-122571 Share on other sites More sharing options...
Zane Posted November 10, 2006 Share Posted November 10, 2006 $arr = array("stuff in the array");funciton myFunction() { global $arr; print_r($arr);} Link to comment https://forums.phpfreaks.com/topic/26800-global-array/#findComment-122574 Share on other sites More sharing options...
Liquid Fire Posted November 10, 2006 Author Share Posted November 10, 2006 Thanks for that. Still getting used to some of the differences from C++ to PHP. Link to comment https://forums.phpfreaks.com/topic/26800-global-array/#findComment-122685 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.