Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top