You are here: Re: Alternative for strripos « PHP Programming Language « IT news, forums, messages
Re: Alternative for strripos

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация