How can the number_format function in PHP be customized to suit specific formatting requirements?

To customize the number_format function in PHP to suit specific formatting requirements, you can specify the number of decimal places, decimal point, and thousands separator as parameters. Additionally, you can use the third parameter to specify how negative numbers should be handled.

$number = 12345.6789;
$formatted_number = number_format($number, 2, '.', ',');
echo $formatted_number; // Output: 12,345.68