質問

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.

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top