What are the potential pitfalls of using commas instead of periods in decimal numbers in PHP?

Using commas instead of periods in decimal numbers in PHP can lead to syntax errors or unexpected behavior in mathematical operations. To avoid this issue, it is important to ensure that decimal numbers are formatted correctly with periods as the decimal separator.

// Incorrect usage of commas instead of periods in decimal numbers
$number = "10,5";
$decimal_number = floatval(str_replace(',', '.', $number));

echo $decimal_number; // Output: 10.5