RE: question about str_replace function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 I think you'd better use regular expression to replace the word

Regards,
Dick
-----Original Message-----
From: Kencana [mailto:bluesky_dyx@xxxxxxxxxxx] 
Sent: Monday, January 08, 2007 5:12 PM
To: php-general@xxxxxxxxxxxxx
Subject:  question about str_replace function


Hi all,

I got a doubt about the str_replace function.

<?php 
$string="avenue 1, ave 1";
$words=str_replace ("ave","avenue", $string);
echo $words;
?>

the php code above will return me "avenuenue 1, avenue 1". i expect the
result will be "avenue 1, avenue 1". any idea of how can i get such result?

Thank you

Regards,
Kencana

-- 
View this message in context:
http://www.nabble.com/question-about-str_replace-function-tf2938171.html#a82
14599
Sent from the PHP - General mailing list archive at Nabble.com.

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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux