为什么这不起作用?
<?php
$computers = array();
$computers[101] = array(
"name" => "phantom NXZT",
"img" => "img/phantom.jpg",
"cpu" => "Intel i7 4770K Quadcore",
"gpu" => "GTX 780 3GB GDDR5",
"ram" => "16GB Corsair 1800mhz",
"hdd" => "Seagate 2TB Hard Drive",
"ssd" => "SanDisk 120GB Solid State",
"price" => 1200
);
?>
<img src="<?php echo $computers["img"];?>">
它作为一个破碎的img链接出现,我希望它将图像url显示到图像src中。我不明白为什么它不起作用请帮忙?
答案 0 :(得分:1)
由于[101]:)
<img src="<?php echo $computers[101]['img'];?>">
对不起,KA_lin先回答