Initial commit.
This commit is contained in:
24
lib/php/monica/htmlchar.inc.php
Normal file
24
lib/php/monica/htmlchar.inc.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// File name: htmlchar.inc.php
|
||||
// Description: PHP subroutines about HTML character entities
|
||||
// Date: 2002-08-13
|
||||
// Author: imacat <imacat@pristine.com.tw>
|
||||
// Copyright: Copyright (C) 2002-2007 Pristine Communications
|
||||
|
||||
// h: Shortcut to htmlspecialchars()
|
||||
function h($a)
|
||||
{
|
||||
return htmlspecialchars($a);
|
||||
}
|
||||
|
||||
// dh: Reverse htmlspecialchars()
|
||||
function dh($a)
|
||||
{
|
||||
$a = str_replace("<", "<", $a);
|
||||
$a = str_replace(">", ">", $a);
|
||||
$a = str_replace(""", "\"", $a);
|
||||
$a = str_replace("&", "&", $a);
|
||||
return $a;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user