$adsense_colors = array(
array('border' => '000000', 'bg' => 'CCCCCC', 'link' => 'CC0000', 'url' => '666666', 'text' => '000000'),
array('border' => '333333', 'bg' => 'FFFFFF', 'link' => '990000', 'url' => 'ff0000', 'text' => '999999'),
array('border' => '999999', 'bg' => '000000', 'link' => '0000FF', 'url' => '00ff00', 'text' => 'ff0000'),
);
$random_color = rand(0,sizeof($adsense_colors));
?>
Then later on, you need to extract the data from the array when you are pasting your ad code:
<script type="text/javascript"><!--
google_ad_client = "";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "<? echo $adsense_colors[$random_color]['border']; ?>";
google_color_bg = "<? echo $adsense_colors[$random_color]['bg']; ?>";
google_color_link = "<? echo $adsense_colors[$random_color]['link']; ?>";
google_color_url = "<? echo $adsense_colors[$random_color]['url']; ?>";
google_color_text = "<? echo $adsense_colors[$random_color]['text']; ?>";
//--></script>
<script type="text/javascript"
src="/jishu513556http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
(出处: