AgerNic.com/ro
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL
Tutorial
Func?ia htmlspecialchars_decode() este o func?ie încorporat? a PHP, care transform? entit??ile HTML predefinite în caractere. Este opus func?iei htmlspecialchars(). Entit??ile HTML decodificate înapoi la personaj vor fi:
& converts as & (ampersand)
" converts as " (double-quote)
' converts as ' (single-quote)
< converts as < (less than)
> converts as > (greater than)
Func?ia htmlspecialchars_decode () este utilizat? pentru a decoda entit??ile HTML în caractere, în timp ce htmlspecialchars() este utilizat? pentru a converti caracterul în entit??i HTML.
Exemplul 1:
<?php
$str = "Aceasta este o propozitie cu &lt;b&gt;caractere ingrosat&lt;/b&gt;.";
echo htmlspecialchars_decode($str);
?>
Ie?irea HTML a codului de mai sus va fi (View Source):
<!DOCTYPE html>
<html>
<body>
Aceasta este o propozitie cu <b>caractere ingrosate</b>.
</body>
</html>
Exemplu 2:
<?php
$str = "Georgica &amp; &#039;Videanu&#039;";
echo htmlspecialchars_decode($str, ENT_COMPAT); // Va converti doar ghilimele duble
echo "<br>";
echo htmlspecialchars_decode($str, ENT_QUOTES); // Converte?te ghilimele duble ?i simple
echo "<br>";
echo htmlspecialchars_decode($str, ENT_NOQUOTES); // Nu converte?te nicio ofert?
?>
Tags: htmlspecialchars_decode (), exemple, PHP online editor, curs gratis

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news 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
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news 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
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


analytics piwika