OSDN Git Service

[add]共通関数群ファイル追加
authorHabu <habu@users.sourceforge.jp>
Fri, 30 Mar 2018 11:16:43 +0000 (20:16 +0900)
committerHabu <habu@users.sourceforge.jp>
Fri, 30 Mar 2018 11:16:43 +0000 (20:16 +0900)
score/common.inc [new file with mode: 0644]

diff --git a/score/common.inc b/score/common.inc
new file mode 100644 (file)
index 0000000..2044153
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+/**
+ * 特殊文字をHTMLエンティティに変換する
+ *
+ * htmlspecialcharsのラッパー
+ *
+ * @param string $str 変換元の文字列
+ * @return string 変換後の文字列
+ */
+function h($str)
+{
+    return htmlspecialchars($str, ENT_QUATES|ENT_HTML5, "UTF-8");
+}