summaryrefslogtreecommitdiffstats
path: root/system/helpers/string_helper.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-08 06:06:35 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-08 06:06:35 +0100
commitcb324bd9268fc6b0c93fd22545bd989771d68b04 (patch)
treec1d37b3f9af6531ee2da5e1c372cbb862cbee82f /system/helpers/string_helper.php
parentfc443553248af8ac0c1cbb635fe9cbb70fdf7b82 (diff)
Some more misc. stuff
Diffstat (limited to 'system/helpers/string_helper.php')
-rw-r--r--system/helpers/string_helper.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php
index 654f721b0..fcdb0aa84 100644
--- a/system/helpers/string_helper.php
+++ b/system/helpers/string_helper.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter String Helpers
*
@@ -153,7 +151,7 @@ if ( ! function_exists('reduce_double_slashes'))
{
function reduce_double_slashes($str)
{
- return preg_replace("#(^|[^:])//+#", "\\1/", $str);
+ return preg_replace('#(^|[^:])//+#', '\\1/', $str);
}
}
@@ -181,7 +179,6 @@ if ( ! function_exists('reduce_multiples'))
function reduce_multiples($str, $character = ',', $trim = FALSE)
{
$str = preg_replace('#'.preg_quote($character, '#').'{2,}#', $character, $str);
-
return ($trim === TRUE) ? trim($str, $character) : $str;
}
}
@@ -211,13 +208,17 @@ if ( ! function_exists('random_string'))
case 'alpha':
switch ($type)
{
- case 'alpha': $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ case 'alpha':
+ $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
- case 'alnum': $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ case 'alnum':
+ $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
- case 'numeric': $pool = '0123456789';
+ case 'numeric':
+ $pool = '0123456789';
break;
- case 'nozero': $pool = '123456789';
+ case 'nozero':
+ $pool = '123456789';
break;
}
return substr(str_shuffle(str_repeat($pool, ceil($len/strlen($pool)))),0,$len);