Kazi ya html_entity_decode

Kazi html_entity_decode inabadilisha viumbe vya HTML kuwa herufi zinazolingana. Tazama mifano kwa ufahamu bora.

Syntax

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

Mfano

Wacha tubadilishe mfuatano wenye vitaki:

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

Matokeo ya kutekeleza kodi:

php'<b>text</b>'

Mfano

Wacha tubadilishe mfuatano na alama ya ampersand:

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

Matokeo ya kutekeleza kodi:

php'test: &'

Tazama pia