title: add space in between output in php
body: <p>I'm trying to add a space in beetwen my php, I need to add a space after the output and remove the comma at the last output. Here is my code</p>
  
  <pre><code>&lt;div id="demo-1" data-zs-src='[
      &lt;?php
      $sql = "SELECT * FROM slider ORDER BY no_urut ASC";
      $result = mysqli_query($conn, $sql);
      if (mysqli_num_rows($result) &gt; 0) {
          while ($data = mysqli_fetch_assoc($result)) {
              echo "\"images/slideshow/".$data['img']."\",";
          }
      }
      ?&gt;
  ]' data-zs-overlay="dots"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>and when I'm run that code, it goes like this</p>
  
  <pre><code>data-zs-src="["images/slideshow/img1.jpg","images/slideshow/img2.jpg","images/slideshow/img3.jpg",]"
  </code></pre>
  
  <p>but I want the code to goes like this</p>
  
  <pre><code>data-zs-src="["images/slideshow/img1.jpg", "images/slideshow/img2.jpg", "images/slideshow/img3.jpg"]"
  </code></pre>