फ़ंक्शन html_entity_decode

फ़ंक्शन html_entity_decode HTML एंटिटीज़ को उनके संबंधित सिंबल में कनवर्ट करता है। बेहतर समझ के लिए उदाहरण देखें।

सिंटैक्स

phphtml_entity_decode(string $string, int $flags = ENT_COMPAT, ?string $encoding = null): string

उदाहरण

आइए टैग वाली स्ट्रिंग को कनवर्ट करें:

php<?php
  $str = '<b>text</b>';
  $res = html_entity_decode($str);
  
  echo $res;
?>

कोड निष्पादन का परिणाम:

php'<b>text</b>'

उदाहरण

आइए एम्परसेंड वाली स्ट्रिंग को कनवर्ट करें:

php<?php
  $str = 'test: &';
  $res = html_entity_decode($str);
  
  echo $res;
?>

कोड निष्पादन का परिणाम:

php'test: &'

यह भी देखें

  • फ़ंक्शन htmlentities,
    जो उल्टा ऑपरेशन करता है
  • फ़ंक्शन htmlspecialchars,
    जो समान उल्टा ऑपरेशन करता है