PHP () işlevi htmlentitiesi kullanarak HTML işlemek için Gözat'ı önleyin

0 Cevap php

I want to display the output of PHP echo statement on the browser. The result is output of htmlentities() function of PHP.

$str = "A 'quote' is <b>bold</b>";
// Expected Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo "<textarea>".htmlentities($str)."</textarea>";
// Expected Outputs: A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;
echo "<textarea>".htmlentities($str, ENT_QUOTES)."</textarea>";

Görünüşe göre, bana veriyor

A 'quote' is <b>bold</b> Benim <textarea> içeride

Bildiriniz.

0 Cevap