I have a below function structure
//function 1 definition
function1(data1) {
function2(data2);
}
//function2 definition
function2(data2){
return array();
}
Here all the user in another php file are calling my function1 and passing some data to it,which in turn enriches it and passes it to function2 which returns an array whose length differs depending upon the data passed.
So now I need to pass this array returned by function2 to function1 and then store entire array into a variable.
Is it possible ?
Posting my comments here in answer section due to the limitation of characters
First thing....yes I am new to PHP..... Second thing.....I have tried this....using different methods...storing it into an array...using json_encode() to print it...but did not work. Third thing....I read many things about using list() but examples always talk about accessing particular element of array and not about the entire array....so asking for help....Fourth thing....sentence "all the user in another php file are calling my function1" was a bad choice of words...Actually the mention was not necessary in the question...Here all users means....in other php I am getting data for all of my users from a database and then that data is being passed to function1 and then in turn function2.....