diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-16 10:39:49 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-16 10:39:49 +0100 |
commit | 039ebcd0bf47d0c4f94abb9d5d60c1692c98aece (patch) | |
tree | 7f4b0674fd810cd79b727c3a96c012bc739ce7bd /user_guide_src/source | |
parent | dd63b0fec2b46de11e2f21ab7369ee66a446698b (diff) | |
parent | 5511fbfd8f3054049037124059487096c9c9dde9 (diff) |
Merge pull request #1191 from tiyowan/develop
Add strip_slashes() to string helper documentation
Diffstat (limited to 'user_guide_src/source')
-rw-r--r-- | user_guide_src/source/helpers/string_helper.rst | 30 |
1 files changed, 30 insertions, 0 deletions
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() ============== |