wildteen88 Posted November 23, 2007 Share Posted November 23, 2007 Because variables act differently when used within functions. If you create a variable outside of a function, then that function will not be able to access variables outside of it and vice versa. In order to use a variable within a function that has been created outside of it you have two options: - Either define the variable as global within the function - Or pass that variable as a parameter to the function In order to understand this more you'll need to read up on variable scope Link to comment https://forums.phpfreaks.com/topic/78440-array-error/page/2/#findComment-397632 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.