I can not get a < to go into a an array or echo out. If I use echo "From: <test@none.net>"; the result is From:.
If I use
$mailheader[] = "From: ".$current_user->display_name." <".$current_user->user_email.">\r\n";
$mailheader[] = "Reply-To: ".$current_user->display_name." <".$current_user->user_email.">\r\n";
$mailheader[] = "Content-type: text/html; charset=iso-8859-1\r\n";
var_dump($mailheader);
The result is
array(3)
{
[0]=> string(37) "From: REMOVED "
[1]=> string(41) "Reply-To: REMOVED "
[2]=> string(46) "Content-type: text/html; charset=iso-8859-1 "
}
It does not show anything starting with the < I have searched but I can’t see why this is. I have tried different ways including adding a \ before < but still it ignores everything past the <.
That’s because
<and>have special meaning in HTML: the browser thinks that you are starting an HTML tag.If you want to see what the real contents of the variable are, either view source or use
htmlspecialcharson the output.