You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 26, 2020. It is now read-only.
<li><strong>nozero</strong>: Numeric string with no zeros.</li>
<li><strong>unique</strong>: Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type.
Returns a fixed length 32 character string.</li>
<li><strong>sha1</strong>: An encrypted random number based on <kbd>do_hash()</kbd> from the <ahref="security_helper.html">security helper</a>.</li>
</ul>
<p>Usage example:</p>
<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>
echo trim_slashes($string); // results in this/that/theother</code></p>
<h2>reduce_multiples()</h2>
<p>Reduces multiple instances of a particular character occuring directly after each other. Example:</p>
<code>
$string="Fred, Bill,, Joe, Jimmy";<br/>
$string=reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy"
</code>
<p>The function accepts the following parameters:
<code>reduce_multiples(string: text to search in, string: character to reduce, boolean: whether to remove the character from the front and end of the string)</code>
The first parameter contains the string in which you want to reduce the multiplies. The second parameter contains the character you want to have reduced.
The third parameter is FALSE by default; if set to TRUE it will remove occurences of the character at the beginning and the end of the string. Example:
<code>
$string=",Fred, Bill,, Joe, Jimmy,";<br/>
$string=reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy"
</code>
</p>
<h2>quotes_to_entities()</h2>
<p>Converts single and double quotes in a string to the corresponding HTML entities. Example:</p>
<code>$string="Joe's \"dinner\"";<br/>
$string=quotes_to_entities($string); //results in "Joe&#39;s &quot;dinner&quot;"
</code>
<h2>strip_quotes()</h2>
<p>Removes single and double quotes from a string. Example:</p>
<code>$string="Joe's \"dinner\"";<br/>
$string=strip_quotes($string); //results in "Joes dinner"