Skip to content

Commit d4e2185

Browse files
mtawiltaylorotwell
andauthored
[9.x] Add $encoding parameter to substr method (#45300)
* Add $encoding parameter * Update Str.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 1e00add commit d4e2185

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Illuminate/Support/Str.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,11 +1125,12 @@ public static function studly($value)
11251125
* @param string $string
11261126
* @param int $start
11271127
* @param int|null $length
1128+
* @param string $encoding
11281129
* @return string
11291130
*/
1130-
public static function substr($string, $start, $length = null)
1131+
public static function substr($string, $start, $length = null, $encoding = 'UTF-8')
11311132
{
1132-
return mb_substr($string, $start, $length, 'UTF-8');
1133+
return mb_substr($string, $start, $length, $encoding);
11331134
}
11341135

11351136
/**

0 commit comments

Comments
 (0)