這裏是我的代碼如何從字符串中刪除匹配的字符?
$a = "Hey there, how do i remove all, the comma from this string,";
$a = str_replace($a,',','';)
echo $a;
我想刪除所有的字符串中使用逗號,我該怎麼做呢?
這裏是我的代碼如何從字符串中刪除匹配的字符?
$a = "Hey there, how do i remove all, the comma from this string,";
$a = str_replace($a,',','';)
echo $a;
我想刪除所有的字符串中使用逗號,我該怎麼做呢?
$a = str_replace(",", "", $a);
大聲笑,多麼愚蠢的錯誤,我參與..謝謝你糾正:) – 2011-04-04 14:34:02
@Ibrahim:我想我們都做過這樣的事情:-P – 2011-04-04 14:36:16
$a = "Hey there, how do i remove all, the comma from this string,";
$a = str_replace(',','',$a);
echo $a;
錯位分號和錯誤的函數參數。
str_replace有什麼問題? – fabrik 2011-04-04 14:26:12
@fabrik參數被倒置;-) – Capsule 2011-04-04 14:51:04