0

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"])
  );  

1 Answer 1

2

You have to add quotation around imgtag 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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.