Php 如何从字符串中删除匹配的字符?

Php 如何从字符串中删除匹配的字符?,php,Php,这是我的密码 $a = "Hey there, how do i remove all, the comma from this string,"; $a = str_replace($a,',','';) echo $a; 我想删除字符串中所有可用的逗号,我该怎么做 $a = str_replace(",", "", $a); 放错了分号和错误的函数参数 分号放错了位置,函数参数也错了。str_replace有什么问题?@fabrik参数被颠倒;-)str_replace有什么问题?@fa

这是我的密码

$a = "Hey there, how do i remove all, the comma from this string,";
$a = str_replace($a,',','';)
echo $a;
我想删除字符串中所有可用的逗号,我该怎么做

$a = str_replace(",", "", $a);
放错了分号和错误的函数参数


分号放错了位置,函数参数也错了。

str_replace有什么问题?@fabrik参数被颠倒;-)str_replace有什么问题?@fabrik参数被颠倒;-)哈哈,我犯了一个多么愚蠢的错误。。谢谢你的纠正:)哈哈,我犯了一个多么愚蠢的错误。。谢谢您的更正:)
$a = "Hey there, how do i remove all, the comma from this string,";
$a = str_replace(',','',$a);
echo $a;