Sample code for 30+ languages & platforms
PHP Extension

StringBuilder EntityDecode

Demonstrates the Chilkat StringBuilder EntityDecode method to decode HTML entities.

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

// Decode the following HTML entities, replacing each with the character represented.
$s = '&eacute; &#233; &#xE9; Latin small letter e with acute';

$sb = new CkStringBuilder();

$sb->Append($s);
$sb->EntityDecode();

// Output: é é é Latin small letter e with acute
print $sb->getAsString() . "\n";

?>