我想只提取数组的值并将其打印到刀片上。我怎样才能实现它?下图是阵列。
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'));
}
答案 0 :(得分:1)
在视图中,您可以像这样遍历数组:
@foreach($mail as $email)
{{$email}}
@endforeach
要将它们存储在输入中,您可以这样做:
{{ Form::text('emalis', implode(" ", $mail)) }}
或
<input name="first_name" type="text" value={{implode(" ", $mail)}}>