Jump to content

To convert html to php


raydona

Recommended Posts

Hi,

  I want to place the following HTML statement inside an echo statement, i.e. in PHP I want to output an image that is also a link.

        <a href="#"><img src="Somefolder/animage.jpg" width="125" height="156" alt="some image" /></a>

 

  All ideas will be greatly appreciated.

 

Link to comment
https://forums.phpfreaks.com/topic/253487-to-convert-html-to-php/
Share on other sites

the following 2 methods can do this

 

<?php
echo "<a href='#'><img src='Somefolder/animage.jpg' width='125' height='156' alt='some image' /></a>";
echo "<a href=\"#\"><img src=\"Somefolder/animage.jpg\" width=\"125\" height=\"156\" alt=\"some image\" /></a>";
?>

 

but you can also break in and out of php if desire

?>

<a href="#"><img src="Somefolder/animage.jpg" width="125" height="156" alt="some image" /></a>

<?php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.