What is the purpose of the $recipient variable in the PHP code snippet?

The $recipient variable in the PHP code snippet is used to store the email address of the recipient to whom the email will be sent. It is a placeholder for the actual email address that will be dynamically inserted into the code when the email is being sent. The purpose of this variable is to make the code more flexible and reusable, allowing the same code to be used to send emails to different recipients by simply changing the value of the $recipient variable.

$recipient = "recipient@example.com";
$subject = "Test Email";
$message = "This is a test email.";
$headers = "From: sender@example.com";

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