アレイからオブジェクトを取得するにはどうすればよいですか。このデータをクエリから取得しています。Laravel 4の配列からオブジェクトをフェッチする方法は?
私は、このテーブルをクエリ:
DB::select("SELECT * FROM verified_data where target_id=3");
この結果取得:
array(124) {
[0]=>
object(stdClass)#445 (8) {
["id"]=>
int(83)
["user_id"]=>
int(0)
["target_id"]=>
int(3)
["target_type"]=>
string(6) "assets"
["user_comments"]=>
string(13) "Well and good"
["created_at"]=>
string(19) "2016-08-11 18:35:39"
["updated_at"]=>
string(19) "2016-08-11 18:35:39"
["is_verified"]=>
int(1)
}
[1]=>
object(stdClass)#446 (8) {
["id"]=>
int(84)
["user_id"]=>
int(0)
["target_id"]=>
int(3)
["target_type"]=>
string(6) "assets"
["user_comments"]=>
string(13) "Well and good"
["created_at"]=>
string(19) "2016-08-11 18:48:07"
["updated_at"]=>
string(19) "2016-08-11 18:48:07"
["is_verified"]=>
int(1)
}
[2]=>
object(stdClass)#447 (8) {
["id"]=>
int(85)
["user_id"]=>
int(0)
["target_id"]=>
int(3)
["target_type"]=>
string(6) "assets"
["user_comments"]=>
string(13) "Well and good"
["created_at"]=>
string(19) "2016-08-11 18:48:26"
["updated_at"]=>
string(19) "2016-08-11 18:48:26"
["is_verified"]=>
int(1)
}
そして私は、このデータから["is_verified"]
をしたいが、どのように私は変数でこれを取得することができますし、それを表示します私のinput
値ですか?
ちょうど '[is_verified]に格納されている値が1または0であることが必要です。どうすればこの値を取得して変数に格納できますか? –