What are common pitfalls when formatting strings in PHP for MySQL storage, especially when dealing with user input variations like different decimal separators?

When formatting strings in PHP for MySQL storage, a common pitfall is not properly handling variations in user input, such as different decimal separators. To address this issue, you can use PHP functions like `str_replace` to normalize the input data before storing it in the database. This ensures that the data is consistent and correctly formatted for MySQL.

// Example code snippet to handle different decimal separators
$userInput = "1,234.56"; // User input with comma as decimal separator
$normalizedInput = str_replace(",", ".", $userInput); // Replace comma with dot
// Now $normalizedInput will be "1.234.56"

// Store $normalizedInput in the database
// mysqli_query($connection, "INSERT INTO table_name (column_name) VALUES ('$normalizedInput')");