仅提取数组的值并打印到刀片LARAVEL

时间:2017-10-24 09:22:58

标签: php arrays laravel

我想只提取数组的值并将其打印到刀片上。我怎样才能实现它?下图是阵列。

enter image description here

public function view_send_email()
{
     $data["_email_list"]=Tbl_press_release_email::get();
     $data["sent_email"] = Request::input('sent_email');
     $mail = Session::get('email'); <--- array i want to get the value of it.
     dd($mail);
     return view("member.email_system.send_email_press_release",compact('data', 'mail'));

}

1 个答案:

答案 0 :(得分:1)

在视图中,您可以像这样遍历数组:

@foreach($mail as $email)
    {{$email}}
@endforeach

要将它们存储在输入中,您可以这样做:

{{ Form::text('emalis', implode(" ", $mail)) }}

<input name="first_name" type="text" value={{implode(" ", $mail)}}>