How can PHP functions like number_format, sprintf, round, ceil, and floor be utilized to manipulate variables effectively?

When working with numerical variables in PHP, functions like number_format, sprintf, round, ceil, and floor can be used to manipulate these variables effectively. number_format can format a number with grouped thousands, sprintf can format a string with placeholders for variables, round can round a number to a specified number of decimal places, ceil can round a number up to the nearest integer, and floor can round a number down to the nearest integer.

$number = 1234.5678;

// Format the number with grouped thousands
$formatted_number = number_format($number, 2);

// Format a string with the number placeholder
$formatted_string = sprintf("The number is %.2f", $number);

// Round the number to 2 decimal places
$rounded_number = round($number, 2);

// Round the number up to the nearest integer
$ceiled_number = ceil($number);

// Round the number down to the nearest integer
$floored_number = floor($number);