| @@ 542-547 (lines=6) @@ | ||
| 539 | return substr($s, $start, null === $length ? 2147483647 : $length); |
|
| 540 | } |
|
| 541 | ||
| 542 | if ($start < 0) { |
|
| 543 | $start = iconv_strlen($s, $encoding) + $start; |
|
| 544 | if ($start < 0) { |
|
| 545 | $start = 0; |
|
| 546 | } |
|
| 547 | } |
|
| 548 | ||
| 549 | if (null === $length) { |
|
| 550 | $length = 2147483647; |
|
| @@ 551-556 (lines=6) @@ | ||
| 548 | ||
| 549 | if (null === $length) { |
|
| 550 | $length = 2147483647; |
|
| 551 | } elseif ($length < 0) { |
|
| 552 | $length = iconv_strlen($s, $encoding) + $length - $start; |
|
| 553 | if ($length < 0) { |
|
| 554 | return ''; |
|
| 555 | } |
|
| 556 | } |
|
| 557 | ||
| 558 | return (string) iconv_substr($s, $start, $length, $encoding); |
|
| 559 | } |
|