65535
65535

Reputation: 553

Laravel: What is the meaning and purpose of the { } operator?

Laravel: What is the meaning and purpose of the { } operator? Is it Laravel specific or is it contained in php?

In the following code, { } is used. What exactly is it, and what does it do?

Any help would be greatly appreciated.

$users = User::all();
        foreach ($users as $user) {
            Mail::raw("{$key} -> {$value}", function ($mail) use ($user) {
                $mail->from('[email protected]');
                $mail->to($user->email)
                    ->subject('Hello');
            });

Upvotes: 0

Views: 367

Answers (1)

FalconTech
FalconTech

Reputation: 46

These means "variable variables". Eg $mysqli->query its the same like ${$aa}->{$bb} when:

$aa = "mysqli";
$bb = "query";

Upvotes: 1

Related Questions