Posts Tagged with php string

Displaying 11-11 of 11 results.
Resolved: PHP replace words in string array without case sensitive
posted by admin on March 11, 2016
I want to replace words in array string, only single word, without contains in another word, only, when the word in format SPACE+WORD+SPACE.

For example

$string = ['Москва — город герой!', 'москва не резиновая', 'москватека не резиновая', 'текамоскватека не резиновая', 'текамосква не резиновая'];


I want to replace all "Москва", and "москва" to Moscow, and get result output like

Array ( [0] => Moscow — город герой! [1] => Moscow не резиновая [2] => москватека не резиновая [3] => текамоскватека не резиновая [4] => текамосква не резиновая )
Read more