What is the purpose of using Bcc (Blind carbon copy) in PHP email headers?

When sending emails in PHP, using Bcc (Blind carbon copy) in the email headers allows you to send a copy of the email to recipients without revealing their email addresses to other recipients. This is useful when you want to send a mass email without disclosing the email addresses of all recipients to each other.

$to = 'recipient@example.com';
$subject = 'Subject of the email';
$message = 'This is the content of the email';
$headers = 'From: sender@example.com' . "\r\n";
$headers .= 'Bcc: hiddenrecipient1@example.com, hiddenrecipient2@example.com' . "\r\n";

// Send email
mail($to, $subject, $message, $headers);