How can you ensure that decimal points are preserved when converting string numbers to integers in PHP?

When converting string numbers to integers in PHP, you need to be cautious about preserving decimal points. To ensure that decimal points are preserved, you can use the `floatval()` function to convert the string to a float number before casting it to an integer. This way, the decimal points will not be truncated during the conversion process.

// Convert string number to integer while preserving decimal points
$stringNumber = "3.14";
$floatNumber = floatval($stringNumber);
$integerNumber = (int)$floatNumber;

echo $integerNumber; // Output: 3