htmlspecialchars() expects parameter 1 to be string, array given in Laravel
问题 I have got this error in my Laravel blade template htmlspecialchars() expects parameter 1 to be string, array given I have tried to convert the array into string in blade template. Here is the code <script> var value = {{ $sliderImageDataArray }}.toString() window.MedicPressSliderCaptions = value; </script> Where $silderImageDataArray is the variable and value stored here. Here is the $silderImageDataArray value [{"title":"First title","text":"<p><span id=\"hs_cos_wrapper_module