How to Remove Comma from String in PHP?

Sep 16, 2022

.

Admin

How to Remove Comma from String in PHP?

Hi Dev,

This tutorial will give you example of how to remove comma from string in php?. I’m going to show you about remove comma from string in php example. This tutorial will give you simple example of php remove comma from string. We will use how to use function to remove comma from string in php?

There are example to remove comma from strings in PHP. in this example, we will use to str_replace() function used to remove commas. so Let's see the following example with output.

Example:


index.php

<?php

$str=",Nices,nippet,s.,com";

// Remove All Comma from String

$result = str_replace(',', '', $str);

echo $result;

?>

Output:

Nicesnippets.com

I hope it could help you...

#PHP