Chris Shiflett wrote:

> View source, and I think you'll understand. Or, remove the call to
> htmlentities().
>
> Chris
..............

Thank you all for your assistance.

Best...
TR
...........

"...when a browser sees  &lt, it prints out a < character instead of
thinking "OK here comes an HTML tag."  This is the same idea (but with a
differnt syntax) as escaping a " or $ charcater inside a double quoted
string..." ~[from Learning PHP5 [O'Reilly] page 102]
--------------------------------


<?php
$str = "I <b>love</b> sweet tea and <div class=\"fancy\">rice.</div> &
tea\n";
echo $str;
echo "<br>";
echo htmlentities($str);
?>

// Output in view source code:

I <b>love</b> sweet tea and <div class="fancy">rice.</div> & tea
<br>I &lt;b&gt;love&lt;/b&gt; sweet tea and &lt;div
class=&quot;fancy&quot;&gt;rice.&lt;/div&gt; &amp; tea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to