How can you format numbers in PHP to include thousand separators?

To format numbers in PHP to include thousand separators, you can use the number_format() function. This function allows you to specify the number you want to format and the number of decimal places to display. By providing the appropriate parameters, you can easily add thousand separators to your numbers in PHP.

$number = 1234567.89;
$formatted_number = number_format($number, 2, '.', ',');
echo $formatted_number; // Output: 1,234,567.89