ฟังก์ชัน htmlspecialchars_decode
ฟังก์ชัน htmlspecialchars_decode ดำเนินการ
ตรงข้ามกับฟังก์ชัน htmlspecialchars
ไวยากรณ์
htmlspecialchars_decode(string $string, int $flags = ENT_COMPAT): string
ตัวอย่าง
มาแปลงสตริงที่มีแท็กกัน:
<?php
$str = '<b>text</b>';
$res = htmlspecialchars_decode($str);
echo $res;
?>
ผลลัพธ์ของการรันโค้ด:
'<b>text</b>'
ดูเพิ่มเติม
-
ฟังก์ชัน
html_entity_decode,
ซึ่งดำเนินการคล้ายกัน -
ฟังก์ชัน
htmlspecialchars,
ซึ่งดำเนินการตรงกันข้าม