title: How to get an array as a list
body: <p>If I type in the wrong extention the array will show like this ["nl","net","com"] but I want it like </p>
  
  <blockquote>
    <p>nl,net,com</p>
  </blockquote>
  
  <p>. How can I do that?</p>
  
  <p>This is the code I use.</p>
  
  <pre><code>$a = array("nl", "net", "com");
  
  $q = $_GET["q"];
  
  $domain = explode(".", $q);
  
  if (in_array($domain[1], $a)) {
      echo $q;
  } else {
      echo json_encode ($a);
  }
  </code></pre>