html special chars code example

Example 1: php convert string to chars

<?php

$str = "Hello Friend";

$arr1 = str_split($str);
$arr2 = str_split($str, 3);

print_r($arr1);
print_r($arr2);

?>

Example 2: html special characters php

$string = "This is testing message "ETC" ";
htmlspecialchars($string, ENT_COMPAT)

Example 3: html special char

< : &lt;
> : &gt;

Example 4: html entity at sign

&#64;
&commat;

Example 5: html special characters

<!-- Answer to: "html special characters" -->

!
&excl;
[
&lsqb; &lbrack;
_
&lowbar;
`
&grave; &DiacriticalGrave;
|
&verbar; &vert; &VerticalLine;
}
&rcub; &rbrace;
¢
&cent;
<!-- There's many more at https://dev.w3.org/html5/html-author/charref -->

Example 6: html entity for $

&dollar;
&#x00024;
&#36;

Tags:

Misc Example