|
Posted by Rik on 01/03/07 16:27
monomaniac21 wrote:
> Rik wrote:
>> Rik wrote:
>>> preg_replace('/i($|i)/si','$1',$string);
>>
>> No need for the /s modifier offcourse...
>> --
>> Rik Wasmus
>
> hi rik that works great for instances of a single i at the end of the
> string (last character) but i also need it to strip out any i's that
> occur next to other i's so for example:
>
> 230ii := 230, 230iiiiii := 230,
> just as 230i := 230
>
The last one should work:
preg_replace('/i+(\b)/i','$1',$string);
--
Rik Wasmus
Navigation:
[Reply to this message]
|