I’m having issues getting arrays to stick within a foreach loop.
$sites = array($siteOne, $siteTwo);
$tags = array('siteURL' => '', 'name' => '');
foreach($sites as $value){
$value = $tags;
$value['siteURL'] = 'one';
$value['name'] = 'two';
}
print_r($sites);
echo '<br>';
print_r($sites[$siteOne]);
echo '<br>';
the few lines were to get output, but I’m only getting the first $sites array to show
my thoughts were that $value=$tags would add that array to each value in the $sites array
maybe I’m not understanding foreach loops correctly?
thanks
try like this
May your need… cheers 🙂