Sample code for 30+ languages & platforms
PHP ActiveX Requires Chilkat v11.1.0+

HTML Encoding

Demonstrates HTML encoding and decoding.

Chilkat PHP ActiveX Downloads

PHP ActiveX
<?php

$crypt = new COM("Chilkat.Crypt2");

$s = '< é ü ç Ω Hello & World ✓ >';

$htmlEncoded = $crypt->encodeString($s,'utf-8','html');
print $htmlEncoded . "\n";

//  Output:
//  < &eacute; &uuml; &ccedil; &ohm; Hello & World &check; >

//  To decode:
$s = $crypt->decodeString($htmlEncoded,'utf-8','html');
print $s . "\n";

//  Output:
//  < é ü ç Ω Hello & World ✓ >

?>