Reputation: 11
How can I display a picture using php array so far using html didn't work its just displaying the string itself. Here is my code for it :
$output = array(
'order_table' => $order_table,
'cart_item' => '<img src="samples/cart.png">' .count($_SESSION["shopping_cart"])
);
Upvotes: 0
Views: 79
Reputation: 16436
You have to add quotation around img
tag and then display it using echo
in php
$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
Upvotes: 2