dimanche 21 octobre 2018

How to view array values in laravel 5?

I had an array from controller named $data which contain this array...

array:4 [▼
0 => "9 May 2011"
1 => "24 0 2013"
2 => "12 0 2013"
3 => "7 April 2014"
]

I want to display the output in blade view using foreach like this:

 @foreach($data as $value)  
     <td></td>
 @endforeach

However, I got this error in the browser.

htmlspecialchars() expects parameter 1 to be string, array given

What is not right with foreach output? Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire