PHP htmlspecialchars

alfa6661
- January 12, 2012
0 (0 votes)
Rate :
fungsi php untuk mengkonversikan karakter-karakter tertentu menjadi kode-kode HTML

Fungsi htmlspecialchars() digunakan untuk mengkonversikan karakter-karakter tertentu menjadi kode-kode HTML.

Syntax

htmlspecialchars(string,quotestyle,character-set)

Contoh :

<?php
$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
echo $new; // &lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;
?>

Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter

– Eric S. Raymond

Have a better explanation?

If you have comments about this post. Please write your comments below

No comments associated with this article