Ibrahim Azhar Armar
Ibrahim Azhar Armar

Reputation: 25745

how do i remove the matched character from a string?

here is my code

$a = "Hey there, how do i remove all, the comma from this string,";
$a = str_replace($a,',','';)
echo $a;

i want to remove all the commas available in the string, how do i do it?

Upvotes: 0

Views: 599

Answers (2)

Christian
Christian

Reputation: 28124

$a = "Hey there, how do i remove all, the comma from this string,";
$a = str_replace(',','',$a);
echo $a;

Misplaced semi-colon and wrong function arguments.

Upvotes: 1

Dejan Marjanović
Dejan Marjanović

Reputation: 19380

$a = str_replace(",", "", $a);

Upvotes: 3

Related Questions