[PHP] Re: Exact string replacement...

2002-02-09 Thread liljim

Hello Desikan,

this should suit your needs.



~James

> Please help me out in the following...
>
>  $is='is';
> echo eregi_replace(" ".$is." "," ","This is a test string which contains
> is in dismissal");
> ?>
>
>
> Actually I want to replace "is" alone from the string and not all the
> words that contains is...




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Exact string replacement...

2002-02-09 Thread cyberskydive

use substr_replace

string substr_replace(string text, string replacement, integer start,
integer length)

EG:

');
print(substr_replace($text, "are", 10, 2));

?>
10 is the place where you want it to start replacement, 2 (is) more forward
it ends.


"Desikan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> Please help me out in the following...
>
>  $is='is';
> echo eregi_replace(" ".$is." "," ","This is a test string which contains
> is in dismissal");
> ?>
>
>
> Actually I want to replace "is" alone from the string and not all the
> words that contains is...
>
> I have tried with "^".$is."$" ---> but yields nothing
>
> Also tried with "\b"...
>
>
> thanks and regards,
> Desikan
>
> --
>   Desikan
>   [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php