0

Hello I am here to ask you a question about php. I had searched many times on web to get a solution, but I haven't found it yet. I have seen a code like this:

$mail_object        =& Mail::factory("smtp", $smtpinfo);
$mail_result        = $mail_object->send($recipients, $headers, $email_msg);

I just need to the the use of ampersand symbol before the Mail::factory.

Marty
  • 37,476
  • 18
  • 87
  • 159
SAarah
  • 3
  • 2

1 Answers1

2

From the documentation, =& is the assignment by reference operator:

Assignment by reference is also supported, using the $var = &$othervar; syntax. Assignment by reference means that both variables end up pointing at the same data, and nothing is copied anywhere.

Marty
  • 37,476
  • 18
  • 87
  • 159