Quantcast
Channel: How to remove unwanted commas from a string? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by neelsg for How to remove unwanted commas from a string?

$
0
0

Probably not very fast, but a simple method may be:

$str = "a,b,c,,,d";$str2 = "";while($str <> $str2) {    $str2 = $str;    $str = str_replace(',,', ',', $str);}

Viewing all articles
Browse latest Browse all 5

Trending Articles