Re: str_replace on words with an array

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

 



On 29/10/06, Alan Milnes <css@xxxxxxxxxxx> wrote:
Dotan Cohen wrote:
> $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuery);
Can you explain what you are trying to do with the ^ and $?  What is a
typical value of the original $searchQuery?

Alan


The purpose of the ^ and the $ is to define the beginning and the end of a word:
http://il2.php.net/regex

I also tried str_replace( $noiseArray, " ", $searchQuery) but that was
replacing the insides of words as well. And with the addition of the
individual letters, that emptied the entire $searchQuery string!

A typical value of $searchQuery could be "What is php?" or "What is
open source". See this site for details:
http://what-is-what.com

Dotan Cohen

http://technology-sleuth.com/

--
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