From dbac73b4011a85c4ac3b3a7a6a8e30533b881155 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sun, 14 Aug 2011 12:23:55 -0600 Subject: Added increment_string() docs and changelog. --- system/helpers/string_helper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/helpers') diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 2f928a7d1..9fa69f46c 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -246,9 +246,11 @@ if ( ! function_exists('random_string')) * Add's _1 to a string or increment the ending number to allow _2, _3, etc * * @param string $str required + * @param string $separator What should the duplicate number be appended with + * @param string $first Which number should be used for the first dupe increment * @return string */ -function increment_string($str, $first = 1, $separator = '_') +function increment_string($str, $separator = '_', $first = 1) { preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match); -- cgit v1.2.3-24-g4f1b