pixelEngine
06-26-2006, 05:55 PM
hi, I am coming from .php to .net and this is my first foray into the language, so please be gentle!
i am trying to convert this simple multiDimensional array from php to asp.net.
$colors = array( "Titanium Silver"=>'999999', "Deep Green"=>'003300', "Mint Green"=>'52a552', "Black Sapphire"=>'000000', "Electric Red"=>'990000', "Alpine White"=>'eae8da', "Mystic Blue"=>'070446',"Powder Blue"=>'659eec', "Ruby Red"=>'6b0a0a', "Dark Silver"=>'545454' );
foreach ($colors as $key => $value) {
echo "<div class=\"swatch\"><a class=\"swatchcolor\" onclick=\"javascript:paintVehicle('$value')\" style=\"background-color:#$value\" href=\"#\"> </a>$key</div>";
}
the desired output is something like this.....
<div class="swatch"><a class="swatchcolor" onclick="javascript:paintVehicle('999999')" style="background-color: #999999;" href="#"> </a>Titanium Silver</div>
totally confused as to where to begin here.
Thanks in advance for any direction!
i am trying to convert this simple multiDimensional array from php to asp.net.
$colors = array( "Titanium Silver"=>'999999', "Deep Green"=>'003300', "Mint Green"=>'52a552', "Black Sapphire"=>'000000', "Electric Red"=>'990000', "Alpine White"=>'eae8da', "Mystic Blue"=>'070446',"Powder Blue"=>'659eec', "Ruby Red"=>'6b0a0a', "Dark Silver"=>'545454' );
foreach ($colors as $key => $value) {
echo "<div class=\"swatch\"><a class=\"swatchcolor\" onclick=\"javascript:paintVehicle('$value')\" style=\"background-color:#$value\" href=\"#\"> </a>$key</div>";
}
the desired output is something like this.....
<div class="swatch"><a class="swatchcolor" onclick="javascript:paintVehicle('999999')" style="background-color: #999999;" href="#"> </a>Titanium Silver</div>
totally confused as to where to begin here.
Thanks in advance for any direction!