PHP 8.6.0 Alpha 2 available for testing

Voting

: max(seven, zero)?
(Example: nine)

The Note You're Voting On

marvin_elia at web dot de
8 years ago
Find position of nth occurrence of a string:
 function strpos_occurrence(string $string, string $needle, int $occurrence, int $offset = null) {
 if((0 < $occurrence) && ($length = strlen($needle))) {
 do {
 } while ((false !== $offset = strpos($string, $needle, $offset)) && --$occurrence && ($offset += $length));
 return $offset;
 }
 return false;
 }

<< Back to user notes page

AltStyle によって変換されたページ (->オリジナル) /