2017-11-26 9 views
0

これまでPHPを使って画像を表示するには、htmlを使用して文字列自体を表示するだけでは機能しませんでした。ここにそれのために私のコードです:あなたはそれをPHPでechoを使用して表示し、その後imgタグを囲む引用を追加し、する必要がPHP配列表示画像

 $output = array( 
      'order_table'  => $order_table, 
      'cart_item'   => '<img src="samples/cart.png">' .count($_SESSION["shopping_cart"]) 
); 

答えて

2

$output = array( 
      'order_table'  => $order_table, 
      'cart_item'   => '<img src="samples/cart.png">' .count($_SESSION["shopping_cart"]), 
); 

echo $output['cart_item']; //This will display the image