I am having the darndest time figuring out how to use a foreach
inside a function
.I have rewritten my code down to the simplest form and still cannot get it to run. This is the simple version of what I am trying to do:
$arr = array("first","second","third");
function myFunction(){
foreach($arr as $val){
echo $val.' | ';
}
}
myFunction();
I know the solution must be one of those "doh" moments but I must risk embarrassment 'cause I can't get it...