Question and answer is powered by AnsPress.io
I am working with PHP with a simple project and I want to display a picture using PHP array. How can I do it?
If you want to display picture using PHP array, you can try this code:
$output = array(
‘order_table’ => $order_table,
‘cart_item’ => ‘<img src=”samples/cart.png”>’ .count($_SESSION[”shopping_cart”]),
);
It is very simple with array.
// Get images as array $images = get_multiple_image($post_id); // Loop over images and echo foreach($images as $img) { echo '<img src="'.$img.'" alt="">'; }