Re: str_replace on words with an array

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

 



# stuttle@xxxxxxxxx / 2006-10-30 21:18:33 +0000:
> Dotan Cohen wrote:
> > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuery);
> 
> Ok, this is what the compiler will see...
> 
> $searchQuery=str_replace("^Array$", " ", $searchQuery);
> 
> Yes, that's a literal Array in the string. You cannot, and you should
> remember this, you cannot concatenate strings and arrays. What would you
> expect it to do?

    DTRT? This is what e. g. zsh does with the right configuration:

    roman@dagan ~ 1108:0 > echo x-{aa,bb,cc}-y
    x-aa-y x-bb-y x-cc-y

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

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