In PHP, how to find the second (or third, or fourth, or Nth) occurrence of a pattern in a string?
PHP includes two great functions to find the first or last occurrence of a given pattern in a string: strpos and strrpos. However these functions are limited to just the first occurrence; what should I do if I need to know the position beyond the first occurrence? (such as second occurrence?)
-
In PHP, how to find the second (or third, or fourth, or Nth) occurrence of a pat...
smallwei

smallwei 5:09 am on October 26, 2009
Use the following functions to get the position return.
source: PHPRO.ORG