ශ්රිතය html_entity_decode
html_entity_decode ශ්රිතය
HTML ස්වරූප අදාල සංකේත වලට පරිවර්තනය කරයි.
වඩා හොඳ අවබෝධයක් සඳහා උදාහරණ බලන්න.
වාක්ය රචනා ක්රමය
html_entity_decode(string $string, int $flags = ENT_COMPAT, ?string $encoding = null): string
උදාහරණය
ටැග සහිත වදන පරිවර්තනය කරමු:
<?php
$str = '<b>text</b>';
$res = html_entity_decode($str);
echo $res;
?>
කේතය ක්රියාත්මක කිරීමේ ප්රතිඵලය:
'<b>text</b>'
උදාහරණය
ඇම්පර්සන්ඩ් සමඟ වදන පරිවර්තනය කරමු:
<?php
$str = 'test: &';
$res = html_entity_decode($str);
echo $res;
?>
කේතය ක්රියාත්මක කිරීමේ ප්රතිඵලය:
'test: &'
මෙයද බලන්න
-
htmlentitiesශ්රිතය,
ප්රතිවිරුද්ධ මෙහෙයුම සිදු කරයි -
htmlspecialcharsශ්රිතය,
සමාන ප්රතිවිරුද්ධ මෙහෙයුමක් සිදු කරයි