Is there any way for me to have a foreach statement like:
foreach($item in $array1){ //code goes here }
Yes:
foreach ($array1 as $item) { // code goes here }
Reference: PHP foreach()