Php Echo Image Src Tag [How To]

Php Echo Image Src Tag [How To]

Dear Googler , If you are googling how to display image via php code, You are in right Placephp echo image src tag Here. Though its very much single line command , its usage in php is very much high.In html if we need to display image we open html tag as :

<img src=”http://nepallica.com/image/nepallica.jpeg>

Where http://nepallica.com/image/nepallica.jpeg is path where image stored.

For this same code,if you want to embed with in your php tag,Here is the code you need to do in your Project.

Correct way:

<?php echo ‘<img src=”http://nepallica.com/image/nepallica.jpeg” height=”10″ width=”10″>’; ?>

 

The most common mistake we made in this tag is confusion between “” and ”.
So If we Place code like below:

<?php echo “<img src=”http://nepallica.com/image/nepallica.jpeg” height=”10″ width=”10″>”; ?>

This is the wrong way. You need to replace “” at the beginning and end of echo tag.

Bikram Kawan

Hello Readers,This is Bikram Kawan from Nepal. You can follow me onG+ Facebook Twitter Connect with me on Google+

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu