0

i haves string such as

andy
**jackie**
rudy
linda
ferry
**jackie**
linda
rudy
ammy
**jackie**
tortia

Is it possible to have it removed everything and get the result only below

 **jackie**
 tortia

it should be possible with substr

thanks

lainard
  • 19
  • 6
  • try using [strrpos](http://php.net/manual/en/function.strrpos.php) that return Find the position of the LAST occurrence of a substring in a string – Matteo Dec 04 '14 at 10:36
  • The title says he wants the third occurrence, not the last occurrence. – Barmar Dec 04 '14 at 10:38

1 Answers1

0

Yes, you can use substr. But at first you have to find third occurence of jackie. Maybe this function will be helpful https://stackoverflow.com/a/18589825/2701717

Community
  • 1
  • 1
Misticek
  • 31
  • 1
  • 3