title: foreach() argument must be of type array|object, null given in
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;title&gt;Fiyat listesi&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method=&quot;post&quot; action=&quot;dosyam.php&quot;&gt;
      Fiyat listesi: &lt;input name=&quot;seçici1[]&quot; type=&quot;checkbox&quot; value=&quot;Fiyat&quot;&gt;
      Gram &lt;input name=&quot;seçici1[]&quot; type=&quot;checkbox&quot; value=&quot;gram&quot;&gt;
  &lt;br&gt;
     Elma: &lt;input  type=&quot;checkbox&quot; name=&quot;Meyve[]&quot; value=&quot;Elma&quot; &gt;&lt;br&gt;
     Kiraz: &lt;input  type=&quot;checkbox&quot; name=&quot;Meyve[]&quot; value=&quot;Kiraz&quot;&gt;
      &lt;input type=&quot;submit&quot; name=&quot;gonder &quot; value=&quot;Anketi Gönder&quot;&gt;
  
  
  
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;?php
  
  
  
  $sec = $_POST[&quot;seçici1&quot;];
  foreach ($sec as $secici){
      echo $secici;
  }
  
  
  $Meyve = $_POST[&quot;Meyve&quot;];
  
  foreach ($Meyve as $deger) {
      echo $deger.&quot;&lt;br&gt;&quot;;
  
  }
  
  $gram = array(&quot;Elma&quot; =&gt; &quot;1.000&quot;, &quot;Kiraz&quot; =&gt; &quot;1.000&quot;, &quot;Elma Fiyat&quot; =&gt;&quot;50TL&quot;, &quot;Kiraz Fiyat&quot;=&gt;&quot;60TL&quot; );
  
  
  if ($deger ==&quot;Elma&quot;){
      echo $gram[&quot;Elma&quot;];
  
  }
  
  if ($deger == &quot;Kiraz&quot;){
      echo $gram[&quot;Kiraz&quot;];
  }
  
  else{
      echo &quot;Yanlış değer&quot;;
  }
  
  
  
  
  
  ?&gt;
  </code></pre>
  <p>output:
  Warning: Undefined array key &quot;seçici1&quot; in C:\xampp\htdocs\phpvideo\Projem\dosyam.php on line 5</p>
  <p>Warning: foreach() argument must be of type array|object, null given in C:\xampp\htdocs\phpvideo\Projem\dosyam.php on line 6</p>
  <p>Warning: Undefined array key &quot;Meyve&quot; in C:\xampp\htdocs\phpvideo\Projem\dosyam.php on line 11</p>
  <p>Warning: foreach() argument must be of type array|object, null given in C:\xampp\htdocs\phpvideo\Projem\dosyam.php on line 13</p>
  <p>Warning: Undefined variable $deger in C:\xampp\htdocs\phpvideo\Projem\dosyam.php on line 21</p>
  <p>Warning: Undefined variable $deger in C:\xampp\htdocs\phpvideo\Projem\dosyam.php on line 26
  Yanlış değer</p>
  <p>Plss help mee</p>