Tutorial
Func?ia htmlspecialchars din PHP este utilizat? pentru a converti caractere în entit??i HTML corespunz?toare, dup? caz. Este utilizat pentru a codifica intrarea utilizatorului pe un site web, astfel încât utilizatorii s? nu poat? introduce coduri HTML d?un?toare într-un site.
Syntax:
htmlspecialchars(string,flags,character-set,double_encode)
Syntax:
htmlspecialchars(string,flags,character-set,double_encode)
Exemplu 1:
<?php
$text = "Aici avem o propozitie cu caractere <b>ingrosate</b>.";
echo htmlspecialchars($text);
?>
Ie?irea HTML a codului de mai sus va fi (View Source):
<!DOCTYPE html>
<html>
<body>
Aici avem o propozitie cu caractere <b>ingrosate</b> .
</body>
</html>
Exemplu 2:
<?php
$convert = "<li><a href='index.php'>Cursuri PHP online cu agernic.com</a></li>";
echo "Original string : ".$convert;
echo "<br />";
htmlspecialchars("<li><a href='index.php'>Cursuri PHP online</a></li>", ENT_QUOTES);
echo "Numai HTML caractere speciale : ".htmlspecialchars($convert);
?>
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout

Find here examples of creative and unique website layouts.
Free CSS HTML Menu

Find here examples of creative and unique website CSS HTML menu.