summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers/string_helper.rst
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source/helpers/string_helper.rst')
-rw-r--r--user_guide_src/source/helpers/string_helper.rst28
1 files changed, 18 insertions, 10 deletions
diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst
index 530af2f89..86b1cdb34 100644
--- a/user_guide_src/source/helpers/string_helper.rst
+++ b/user_guide_src/source/helpers/string_helper.rst
@@ -10,9 +10,7 @@ strings.
Loading this Helper
===================
-This helper is loaded using the following code
-
-::
+This helper is loaded using the following code::
$this->load->helper('string');
@@ -88,11 +86,16 @@ your loop the next item will be returned.
repeater()
==========
-Generates repeating copies of the data you submit. Example
+.. php:function:: repeater($data, $num = 1)
-::
+ :param string $data: Input
+ :param int $num: Number of times to repeat
+ :returns: string
+
+Generates repeating copies of the data you submit. Example::
- $string = "\n"; echo repeater($string, 30);
+ $string = "\n";
+ echo repeater($string, 30);
The above would generate 30 newlines.
@@ -143,13 +146,19 @@ The above will return the following array:
trim_slashes()
==============
-Removes any leading/trailing slashes from a string. Example
+.. php:function:: trim_slashes($str)
-::
+ :param string $str: Input string
+ :returns: string
+
+Removes any leading/trailing slashes from a string. Example::
$string = "/this/that/theother/";
echo trim_slashes($string); // results in this/that/theother
+.. note:: This function is DEPRECATED. Use the native ``trim()`` instead:
+ |
+ | trim($str, '/');
reduce_multiples()
==================
@@ -195,5 +204,4 @@ strip_quotes()
Removes single and double quotes from a string. Example::
$string = "Joe's \"dinner\"";
- $string = strip_quotes($string); //results in "Joes dinner"
-
+ $string = strip_quotes($string); //results in "Joes dinner" \ No newline at end of file