I have 3 arrays and want to merge them together.
So i can use it in ONE foreach
<?php
print_r($zaza_optionsbase['header-icon-title']);
print_r($zaza_optionsbase['header-icon']);
print_r($zaza_optionsbase['header-icon-link']);
?>
ARRAY ( [0] => FIRST TITLE [1] => SECOND TITLE [2] => THIRTH TITLE )
ARRAY ( [0] => FA FA-HEART [1] => FA FA-POWER-OFF [2] => FA FA-TH )
ARRAY ( [0] => LINK1 [1] => LINK2 [2] => LINK3 )
Something like below.. but i can't get it to work
<?php
$newArray = array($zaza_optionsbase['header-icon-title'], $zaza_optionsbase['header-icon'], $zaza_optionsbase['header-icon-link']);
foreach ($newArray as $item)
{
echo '<a href="'.$item['header-icon-title'].'"><i class="'.$item['header-icon-icon'].'"></i>'.$item['header-icon-link'].'</a>';
}
?>
Thanx in advanced
it must output:
echo '<a href="'.$item['header-icon-title[1]'].'"><i class="'.$item['header-icon-icon[1]'].'"></i>'.$item['header-icon-link[1]'].'</a>';
echo '<a href="'.$item['header-icon-title[2]'].'"><i class="'.$item['header-icon-icon[2]'].'"></i>'.$item['header-icon-link[2]'].'</a>';
echo '<a href="'.$item['header-icon-title[3]'].'"><i class="'.$item['header-icon-icon[3]'].'"></i>'.$item['header-icon-link[3]'].'</a>';
echo ''.$item['header-icon-link[1]'].'';
echo ''.$item['header-icon-link[2]'].'';
echo ''.$item['header-icon-link[3]'].''; – Nasco Jun 29 '16 at 21:09