A simplified version of what I am trying to do can be seen below:
class report {
var $myArray;
function getData(){
$this->myArray = $_GET['data'];
print_r($this->myArray);
}
}
I have 10 input fields named data[1], data[2], ... , data[10].
The first line of my getData function returns a notice that says "Array to string conversion" and the second line simply outputs "Array". However, if I use the following code in the getData function, the array is displayed correctly: print_r($_GET['data']).
The code is not meant to simply print out the array, I am just doing that to try and solve my problem. I need to store it in the variable, but cant figure out whats wrong. I tried to declare the variable as var $myArray = array(); , but that didnt work. Any ideas?
Thanks