這是我的代碼:的preg_replace沒有忽視[]從字符串
$string = "Hello this is my text [readmore] and this is remaining text";
echo preg_replace("[readmore]","",$string);
這是我預期輸出:
Hello this is my text and this is remaining text
這是我實際輸出:
Hello this is my text [] and this is remaining text
問題很簡單如何獲得乘坐「[]」也是?
使用'str_replace'函數,檢查我的答案。它會工作 – 2013-04-20 08:22:12