title: Fatal error: Cannot redeclare connectt() (previously declared in
body: <p>I tried some posts but nothing could solve my error, someone can see where I have an error?
  It shows: Fatal error: Cannot redeclare connectt() (previously declared in</p>
  
  <pre><code>&lt;?php
  $jsonContents = file_get_contents('data/data.json');
  $data_array = json_decode($jsonContents, true);
  foreach($data_array as $key=&gt; $value) {
      $domain = $value['domain'];
      function connectt($domain, $port, $timeOut = 5)
      {
          $fp = fsockopen($domain, $port, $errno, $errstr, $timeOut);
          if (!$fp) {
              $jsonContents = file_get_contents('data/data.json');
              $data_array = json_decode($jsonContents, true);
              foreach ($data_array as $key =&gt; $value) {
                  $domain = $value['domain'];
                  $data_array = json_decode($jsonContents, true);
                  $jsonContents = file_get_contents('data/data.json');
                  if ($value['domain'] == $domain) {
                      $data_array[$key]['ssl'] = "Not Valid";
                  }
              };
              $json = json_encode($data_array);
              file_put_contents('data/data.json', $json);
          } else {
              $jsonContents = file_get_contents('data/data.json');
              $data_array = json_decode($jsonContents, true);
              foreach ($data_array as $key =&gt; $value) {
                  $domain = $value['domain'];
                  $jsonContents = file_get_contents('data/data.json');
                  $data_array = json_decode($jsonContents, true);
                  if ($value['domain'] == $domain) {
                      $data_array[$key]['ssl'] = "Valid";
                  }
                  $json = json_encode($data_array);
                  file_put_contents('data/data.json', $json);
              }
          }
      }
      $port = 443;
      connectt($domain, $port);
  }
  </code></pre>