john john - 2 years ago 66
PHP Question

Do not escape html stored as string (execute or process html string)

In PHP (Wordpress theme function, trying to add html stored in theme options to blog header),
I'm trying to get the following line:

$x="<p>html</p>"; echo $x;

To render html just like:

echo "<p>html</p>";

The results are different, the first one will display html tags while the second will process the html.
Can someone please help.

csi csi
Answer Source

Use single quotes

Single quotes vs double quotes in PHP

echo '<p>HTML</p>';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download