I want to create associative array from foreach loop.
if (sizeof($ads) > 0) {
foreach($ads as $social_item) {
$sdbr .= $social_item['sidebar'];
$pno .= $social_item['no'];
}
echo $sdbr // cow hen
echo $pno // milk egg
}
How can I create associative array like this one?
$out = array("cow"=>"milk","hen"=>"egg");
$outarray. It will end up with only the last associated 'no' value.cow=>steak,hen=>breast