summaryrefslogtreecommitdiffstats
path: root/user_guide/helpers/string_helper.html
diff options
context:
space:
mode:
authorGreg Aker <greg@gregaker.net>2011-08-20 18:58:58 +0200
committerGreg Aker <greg@gregaker.net>2011-08-20 18:58:58 +0200
commitabbad9ea53e81c6e3211029711ac5b2ab4f1978d (patch)
tree9a4d5a8587da1dd3a365251afa37be2f835a53c2 /user_guide/helpers/string_helper.html
parent71644d683d0a15a6f7e04fabd0f51a4200d620b4 (diff)
parentd56be70257696d0bbf2dcc880888d8dc17cba21c (diff)
Merge branch 'develop' into feature/unit-tests
Conflicts: .hgignore
Diffstat (limited to 'user_guide/helpers/string_helper.html')
-rw-r--r--user_guide/helpers/string_helper.html19
1 files changed, 15 insertions, 4 deletions
diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html
index 6fc2cf5f7..314124037 100644
--- a/user_guide/helpers/string_helper.html
+++ b/user_guide/helpers/string_helper.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 2.0.2</h1></td>
+<td><h1>CodeIgniter User Guide Version 2.0.3</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
@@ -70,9 +70,9 @@ String Helper
<h2>random_string()</h2>
-<p>Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.</p>
+<p>Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.</p>
-<p>The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:</p>
+<p>The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:</p>
alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1
<ul>
@@ -90,9 +90,20 @@ String Helper
<code>echo random_string('alnum', 16);</code>
+<h2>increment_string()</h2>
+
+<p>Increments a string by appending a number to it or increasing the number. Useful for creating "copies" or a file or duplicating database content which has unique titles or slugs.</p>
+
+<p>Usage example:</p>
+
+<code>echo increment_string('file', '_'); // "file_1"<br/>
+echo increment_string('file', '-', 2); // "file-2"<br/>
+echo increment_string('file-4'); // "file-5"<br/></code>
+
+
<h2>alternator()</h2>
-<p>Allows two or more items to be alternated between, when cycling through a loop. Example:</p>
+<p>Allows two or more items to be alternated between, when cycling through a loop. Example:</p>
<code>for ($i = 0; $i < 10; $i++)<br />
{<br />