1
我有一個關鍵字這樣的格式使用php查找數組中的關鍵字?
sample text
我也有一個數組這樣的格式如下
Array
(
[0] => Canon sample printing text
[1] => Captain text
[2] => Canon EOS Kiss X4 (550D/Rebel T2i) + Double Zoom Lens Kit
[3] => Fresh sample Roasted Seaweed
[4] => Fresh sample text Seaweed
)
我想找到這個陣中sample text
關鍵字。 我預期的結果
Array
(
[0] => Canon sample printing text //Sample and Text is here
[1] => Captain text //Text is here
[3] => Fresh sample Roasted Seaweed //Sample is here
[4] => Fresh sample text Seaweed //Sample text is here
)
我已經在努力strpos
但它沒有得到正確的答案
請告知
什麼呢?我是指preg_grep()? –
'我'是爲了忽略大小寫,'〜'是正則表達式分隔符。 – anubhava