We have created function to rotate banners by it's priority value.
We had run this to three banners only, But now we need multiple banners.
We used this array
$arr1 = array(
array("url" => "1", "priority" => $AD_weight_1),
array("url" => "2", "priority" => $AD_weight_2),
array("url" => "3", "priority" => $AD_weight_3),
);
But now we can't add number or ad weight manually, So we tried to use something like this but it's not working and show only last number of loop !!
$ads_limit = 7;
for ($xy = 0; $xy < $ads_limit; $xy++)
{
$arr1 = array(
array("url" => $xy, "priority" => $ad_groups[$xy]['ad_before_post_weight']),
);
}
print_r ($arr1);
Can we use loop inside array or you have any idea for this ?