|
Posted by Oli Filth on 12/28/05 23:17
frizzle said the following on 28/12/2005 20:53:
> 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?
>
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.
--
Oli
[Back to original message]
|