From 1cea8bc686e789a957a375079d812beee8718603 Mon Sep 17 00:00:00 2001 From: AliiAhmadi Date: Fri, 9 Dec 2022 10:52:51 +0330 Subject: [PATCH] Add some security function --- htmlspecialchars.php | 19 +++++++++++++++++++ stripslashes.php | 14 ++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 htmlspecialchars.php create mode 100644 stripslashes.php diff --git a/htmlspecialchars.php b/htmlspecialchars.php new file mode 100644 index 0000000..48c9388 --- /dev/null +++ b/htmlspecialchars.php @@ -0,0 +1,19 @@ +" convert to ">" + ... +*/ +$str = "The word text is bold"; +echo htmlspecialchars($str); +// HTML output will be "The word <b>text</> is bold" + +$str = "My name is 'Ali'"; +echo htmlspecialchars($str); + +$str = "What is decrement & increment ?"; +echo htmlspecialchars($str); \ No newline at end of file diff --git a/stripslashes.php b/stripslashes.php new file mode 100644 index 0000000..4c4710a --- /dev/null +++ b/stripslashes.php @@ -0,0 +1,14 @@ +