0
我想做一個數組上的字符串替換。PHP的str_replace不工作在我的情況下
我..
str_replace('texts', 'testssssss', $test->html);
的$test->html
回報
,我想,以取代所有文本到testssssss ..
key 1
<div>
<a href='texts.company.name.html'>test</a>
</div>
Key 2
<div>
other html...
</div>
Key 3
<div>
other html...
</div>
Key 4
<div>
<a href='texts.department.name.html'>department</a>
</div>
more...
感謝您的幫助!
你記得返回字符串將'str_replace'的輸出分配給一個變量? –
你真的重新分配了返回值嗎? –
您必須將str_replace的結果分配給某個變量或其他變量 –