我有一个数组变量
$usersColor = array
(
"nica" => "blue",
"rejie" => "red",
"evan" => "green"
);
假设我有这段代码..
<div class='nica' style="color:(user array color)"> </div> //shoud be the color of nica
如何比较并获取给定键的相应用户div颜色?
答案 0 :(得分:0)
这样做,因为你知道它是nica
:
<div class='nica' style="color:<?=$usersColor['nica']?>"> </div>