mardi 11 juillet 2017

Get specific key value from array

I'm trying to get a specific value from an array key, but I can't seem to figure out how to make it work.

$Array = Array(
    "key1" => "value1",
    "key2" => "value2"
);

Let's say I want to get the value of "key1" only, and I return the array with the view.

return view("myview")->with("arraytoprint", $Array);

And I try it with blade but I get Trying to get property of non-object...

@foreach($arraytoprint as $arr)

@endforeach

How can this be achieved?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2tK3z1R
via IFTTT

Aucun commentaire:

Enregistrer un commentaire