From 5511fbfd8f3054049037124059487096c9c9dde9 Mon Sep 17 00:00:00 2001 From: tiyowan Date: Thu, 15 Mar 2012 21:53:07 +0400 Subject: Add strip_slashes() to string helper documentation --- user_guide_src/source/helpers/string_helper.rst | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst index dc70e461a..2d23fb00c 100644 --- a/user_guide_src/source/helpers/string_helper.rst +++ b/user_guide_src/source/helpers/string_helper.rst @@ -108,6 +108,36 @@ found in http://. Example $string = "http://example.com//index.php"; echo reduce_double_slashes($string); // results in "http://example.com/index.php" +strip_slashes() +=============== + +Removes any slashes from a string. Example + +:: + + $str = "Is your name O\'reilly?"; + echo strip_slashes($str); // results in Is your name O'reilly? + +You can also use an array. Example + +:: + + $str = array( + 'question'  => 'Is your name O\'reilly?', + 'answer' => 'No, my name is O\'connor.' + ); + + $str = strip_slashes($str); + +The above will return the following array: + +:: + + array( + 'question'  => "Is your name O'reilly?", + 'answer' => "No, my name is O'connor." + ); + trim_slashes() ============== -- cgit v1.2.3-24-g4f1b