How can the number_format function be used to format a variable within an echo statement in PHP?

When using the `number_format` function to format a variable within an `echo` statement in PHP, you need to first apply the `number_format` function to the variable and store the formatted value in a new variable. Then, you can use this new variable within the `echo` statement to display the formatted number.

<?php
$number = 1234.56;
$formatted_number = number_format($number, 2); // Format the number with 2 decimal places
echo "The formatted number is: $formatted_number";
?>