title: htmlspecialchars() expects parameter 1 to be string, array given in Laravel
body: <p>I have got this error in my <code>Laravel</code> blade template</p>
  
  <blockquote>
    <p>htmlspecialchars() expects parameter 1 to be string, array given</p>
  </blockquote>
  
  <p>I have tried to convert the array into string in blade template. </p>
  
  <p><strong>Here is the code</strong></p>
  
  <pre><code>&lt;script&gt;
      var value = {{ $sliderImageDataArray }}.toString()
      window.MedicPressSliderCaptions = value;
  &lt;/script&gt;
  </code></pre>
  
  <p>Where <code>$silderImageDataArray</code> is the variable and value stored here.</p>
  
  <p><strong>Here is the <code>$silderImageDataArray</code> value</strong></p>
  
  <pre><code>[{"title":"First title","text":"&lt;p&gt;&lt;span id=\"hs_cos_wrapper_module_1498510869515998\" class=\"hs_cos_wrapper hs_cos_wrapper_widget_container hs_cos_wrapper_type_widget_container\" data-hs-cos-general-type=\"widget_container\" data-hs-cos-type=\"widget_container\"&gt;First title&lt;\\\/span&gt;&lt;\\\/p&gt;\n&lt;p&gt;&lt;a class=\"btn  btn-secondary\" href=\"http:\\\/\\\/localhost\\\/sencare\\\/book-appoinment\\\/\" target=\"_self\"&gt;  Make An Appointment &lt;\\\/a&gt;\\u00a0&lt;a class=\"btn  btn-light\" href=\"http:\\\/\\\/localhost\\\/sencare\\\/our-doctors\\\/\" target=\"_self\"&gt; Our Doctors&lt;\\\/a&gt;&lt;\\\/p&gt;\n","is_video":false},{"title":"Second","text":"&lt;p&gt;&lt;span id=\"hs_cos_wrapper_module_1498510869515998\" class=\"hs_cos_wrapper hs_cos_wrapper_widget_container hs_cos_wrapper_type_widget_container\" data-hs-cos-general-type=\"widget_container\" data-hs-cos-type=\"widget_container\"&gt;Second&lt;\\\/span&gt;&lt;\\\/p&gt;\n&lt;p&gt;&lt;a class=\"btn  btn-secondary\" href=\"http:\\\/\\\/localhost\\\/sencare\\\/book-appoinment\\\/\" target=\"_self\"&gt;  Make An Appointment &lt;\\\/a&gt;\\u00a0&lt;a class=\"btn  btn-light\" href=\"http:\\\/\\\/localhost\\\/sencare\\\/our-doctors\\\/\" target=\"_self\"&gt; Our Doctors&lt;\\\/a&gt;&lt;\\\/p&gt;\n","is_video":false}]
  </code></pre>