Jump to content

Array Error


Dysan

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.