Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.
Moderator: General Moderators
pHp_n0ob
Forum Commoner
Posts: 35 Joined: Mon Jul 09, 2012 7:30 am
Location: India
Post
by pHp_n0ob » Thu Oct 18, 2012 11:40 am
It will show you some HTML Special Characters you dont even know!
Works best with Mozilla Firefox.
Code: Select all
<?php
echo '<html>
<head>
<title>HTML Special Characters</title>
</head>
</body>
<center><h2>HTML Special Characters</h2>
<font color="green">Values</font> - <font color="red">Chars</font></center>' ;
for($i=2;$i<=11097;$i++){
$post_bg=($bg++%2==0 )?"background-color:black;color:white":"background-color:white;color:black";
echo '<div style="'.$post_bg . ';text-align:center">
<font color="green">&#'.$i.';</font>-<font color="red">&#'.$i. ';</font>
</div>';
}
echo '</body>
</html>' ;
?>
requinix
Spammer :|
Posts: 6617 Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA
Post
by requinix » Thu Oct 18, 2012 12:28 pm
Decimal HTML entities, yeah. You can do it in hex too.
kiash
Forum Newbie
Posts: 7 Joined: Sat Aug 07, 2021 1:42 am
Contact:
Post
by kiash » Sat Aug 07, 2021 10:36 am
you can use
function to encode all html entities. it will then very safe for your code
I am a full stack developer. My persoal site
Kiash.io and I work for
Slide.pub as a lead developer.