Are there any best practices for including PHP variables in email subjects?

When including PHP variables in email subjects, it is important to properly sanitize and validate the variables to prevent any potential security vulnerabilities such as email header injection. One best practice is to use a function like `filter_var()` with the `FILTER_SANITIZE_STRING` filter to clean the variable before including it in the subject line.

// Example of including a PHP variable in an email subject
$subject = 'New message from ' . filter_var($sender_name, FILTER_SANITIZE_STRING);