如何去掉一個字符串中某個字符 php
1 回答

海綿寶寶撒
TA貢獻1809條經驗 獲得超8個贊
用字符串替換就行了,將你想換掉的字符替換為空就可以了。
比如說:
你原來的字符串是 "abcdefg",想將其中的a去掉,則可以用以下方法
$str="abcdefg";
$str=str_replace('a','',$str);
echo $str;
- 1 回答
- 0 關注
- 746 瀏覽
添加回答
舉報
0/150
提交
取消