我們?nèi)绾卧诓粍h除字符串中的空格的情況下刪除數(shù)字和特殊字符?例如:$input = "Random string with random 98 and %$% output"; $filtered_input = preg_replace("/[^a-zA-Z\s]/", "", $input);我已經(jīng)嘗試了上面的代碼,但它不起作用。我也試過(guò)閱讀php手冊(cè),但我不太明白內(nèi)容。我在網(wǎng)上找到的所有示例都從字符串中刪除了空格。任何人都可以告訴我如何完成它或?yàn)槲彝扑]一些好的閱讀
- 1 回答
- 0 關(guān)注
- 160 瀏覽
添加回答
舉報(bào)
0/150
提交
取消