title: "TypeError: implode(): Argument #2 ($array) must be of type ?array, string given" in PHP 8
body: <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;form-group col-md-8&quot; id=&quot;my&quot; style=&quot;display: none;&quot;&gt;
      &lt;label&gt;Choose Vpn Server&lt;/label&gt;
      &lt;div class=&quot;row&quot;&gt;
          &lt;?php
              $sqlUrl4 = &quot;SELECT * FROM vpn_networks&quot;;
              $result4 = myQuery($sqlUrl4);
  
              while ($row4 = myFetchArray($result4)) {
          ?&gt;
          &lt;div class=&quot;col-sm-4 text-center&quot;&gt;
              &lt;label&gt;
                  &lt;input type=&quot;checkbox&quot; name=&quot;vpn_network[]&quot; value=&quot;&lt;?php echo $row4['id'];?&gt;&quot; id=&quot;iptv&quot; /&gt;
                  &lt;?php echo $row4['title'];?&gt;
              &lt;/label&gt;
          &lt;/div&gt;
          &lt;?php
                      }
                  ?&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <pre><code>$vpn1 =implode(',', $_POST['vpn_network']?? '');
  </code></pre>
  <p>Error:</p>
  <pre><code>Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must
  be of type ?array, string given in
  C:\xampp\htdocs\ideology\partnerprocess.php:22 Stack trace: #0
  C:\xampp\htdocs\ideology\partnerprocess.php(22): implode(',', '') #1
  {main} thrown in C:\xampp\htdocs\ideology\partnerprocess.php on line
  22
  </code></pre>