@@ 553-565 (lines=13) @@ | ||
550 | * @param int $offset |
|
551 | * @return bool|int |
|
552 | */ |
|
553 | public static function planetStrrPos($haystack, $needle, $offset = 0) |
|
554 | { |
|
555 | if (5 == substr(PHP_VERSION, 0, 1)) { |
|
556 | return strrpos($haystack, $needle, $offset); |
|
557 | } |
|
558 | $index = strpos(strrev($haystack), strrev($needle)); |
|
559 | if (false === $index) { |
|
560 | return false; |
|
561 | } |
|
562 | $index = strlen($haystack) - strlen($needle) - $index; |
|
563 | ||
564 | return $index; |
|
565 | } |
|
566 | } |
|
567 | ||
568 | endif; |
@@ 542-554 (lines=13) @@ | ||
539 | * @param int $offset |
|
540 | * @return bool|int |
|
541 | */ |
|
542 | function planetStrrPos($haystack, $needle, $offset = 0) |
|
543 | { |
|
544 | if (5 == substr(PHP_VERSION, 0, 1)) { |
|
545 | return strrpos($haystack, $needle, $offset); |
|
546 | } |
|
547 | $index = strpos(strrev($haystack), strrev($needle)); |
|
548 | if (false === $index) { |
|
549 | return false; |
|
550 | } |
|
551 | $index = strlen($haystack) - strlen($needle) - $index; |
|
552 | ||
553 | return $index; |
|
554 | } |
|
555 | endif; |
|
556 |