1
在這段代碼中,我試圖從數組中顯示圖像,但是,我得到的數組是字符串轉換錯誤。從我GOOGLE了,你將不得不使用print_r
爲了打印字符串,但我不完全知道我怎麼能做到這一點:數組到字符串轉換
<?php
$item_array = array(
1 => array('product_img' => "images/013_8c9f517a.jpg",
'product_name' => "black tshirt",
'product_price' => "€99.00"),
2 => array('product_img' => "images/014_28ded7a4.jpg",
'product_name' => "white tshirt",
'product_price' => "€99.00"));
echo "<img src=$item_array[1]['product_img']>";
?>