Alternative for strripos

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi there,

I'm trying to filter a big string.
For that, i need the opposite of strpos.
Strrpos doesn't work with strings as 'needle',
i found strripos does accept strings as 'needle',
but that's only from PHP 5. I only have Version 4.3.11.

Any clues out there?

Thanks. Frizzle.

Re: Alternative for strripos

frizzle said the following on 28/12/2005 20:53:
Quoted text here. Click to load it

I guess you could reverse your needle and haystack (strrev()), convert  
them both to lower-case (strtoupper()), use a case-sensitive forward  
search (strpos()), and then convert the return value with some simple  
maths and strlen().

A bit long-winded and inefficient, but should do the job.


Re: Alternative for strripos

Oli Filth wrote:
Quoted text here. Click to load it

Ok, i get what you mean, i sort of thought of this myself, but i was
hoping there would be a better solution.

My final goal is to copy content of a soccer-webpage, filter it, and
come up with the current score of all the teams.
The scheme is at

The regarding scheme is the one with "Stand" in the bright orange beam.
What i need is to find 12 appearances of teams from the DB after each
other (in every next line) and then break the lines up into an array
with 10 items in it ...

I hope this makes sense ...

I have all the teams in the current competition in my DB.

Site Timeline