我有這個數組:PHP:如何獲得'不匹配'字符串?
$GivenString = array("world", "earth", "extraordinary world");
如何讓 '失配' 的變量,像這樣的字符串:
$string = 'hello, world'; // output = 'hello, '
$string = 'down to earth'; // output = 'down to '
$string = 'earthquake'; // output = ''
$string = 'perfect world'; // output = 'perfect '
$string = 'I love this extraordinary world'; // output = 'I love this '
的感謝!
可以用空字符串替換每個字符串數組中每個出現的單詞。 –
你有什麼試過?什麼都沒有奏效?你已經做了什麼研究來解決這個問題?您是否查看了[string](http://php.net/book.strings)和[array](http://php.net/book.array)函數列表,查看可能有用的東西? – Charles
'unmatch('a b c',array('a b','b c'))''a'或''c''?那麼'array('a b','a b c')'? – irrelephant