I'm learning PHP particularly about functions.. This question might looks silly but i want to know how below function will work..
function iterateArray($array)
{
foreach($array as $item) {
$newArray[] = 'Iterated: ' . $item;
}
return $newArray;
}
Here i tried to use the above function on my below code
$new = array('one', 'two', 'Three');
$myvar = iterateArray($new);
echo $myvar;
//echo $myvar[];
//echo $myvar[0];
These all effects as an error.. anyone can explain this..