0

I want to comma separate last name and first name in the result. How can I do this? I tried:

$headers .= 'From:'.$gender.''.$last_name.','.$first_name.'<'.$email.'>' . "\r\n".

but this does not work.

When I use:

$headers .= 'From:'.$gender.''.$last_name.''.$first_name.'<'.$email.'>' . "\r\n".

it does work, but no comma is added.

Can anyone help please?

Eddy
  • 566
  • 2
  • 8
  • 28

1 Answers1

0

Change the simple quotes to double quotes, so you can get the text as you are searching

$headers .= "From: $gender $last_name, $first_name <$email>\r\n";

More info: https://stackoverflow.com/a/3446286/5586647

Community
  • 1
  • 1
Neobugu
  • 333
  • 6
  • 15