| Junior Member with 18 posts. THREAD STARTER | | Join Date: Jan 2009 Experience: Beginner | |
Solved: How Do I Print HTML Code Without It Executing? I am trying to streamline some work by having a PHP page automatically generate HTML code I can cut and paste into a webpage, save the page, and voila! Done!
I thought I needed to use the html special characters, but I'm running into problems.
echo '<' . 'img src="' . $dirname . $file . '"' . "<br>" . 'alt="AlternateText"' . "<br>" . 'title="TitleText"' . "<br>" . $dimensions[3] . ">" . "<br>";
prints:
<img src="/images/updates/2009/Q4/12/02/CM/kitten.jpg"
alt="AlternateText"
title="TitleText"
width="590" height="885">
instead of (what I'm looking for):
<img src="/images/updates/2009/Q4/12/02/CM/kitten.jpg"
alt="AlternateText"
title="TitleText"
width="590" height="885">
It appears it is interpreting ('<' . 'img src="') as one long string instead of echoing the < and then "img=".
So, does anyone know how I either:
indicate the end of the HTML special character string <
or, achieve the same result a different way
Many thanks! |