My code is similar to;
function myFunc() {
$myArry = array();
$myArry[1]['first'] = "First";
$myArry[1]['second'] = "Second";
$myArry[2]['first'] = "First";
$myArry[2]['second'] = "Second";
$myArry[3]['first'] = "First";
$myArry[3]['second'] = "Second";
echo "before return: ".count($myArry);
return $myArry;
}
// main code
$returnedArry = array(myFunc());
echo "after return: ".count($returnedArry);
Output:
before return: 3
after return: 1
What is happening here, can someone please explain? Also, what should I be doing?
Thank you.