W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
你可以通過 Illuminate\Http\Request 的實例,經(jīng)由幾個簡潔的方法取得所有的用戶輸入數(shù)據(jù)。不需要擔心發(fā)出請求時使用的 HTTP 請求,取得輸入數(shù)據(jù)的方式都是相同的。
$name = Request::input('name');
$name = Request::input('name', 'Sally');
if (Request::has('name'))
{
//
}
$input = Request::all();
$input = Request::only('username', 'password');
$input = Request::except('credit_card');
如果是「數(shù)組」形式的輸入數(shù)據(jù),可以使用「點」語法取得數(shù)組:
$input = Request::input('products.0.name');
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: