title: How can I to fliter CSV file By author and by title?
body: <p>How can I filter the file "By author" and "By name"? It turned out only to read the file itself. I do not know what to do next.  </p>
  
  <pre><code>if (isset($_POST['filter'])) {
      $row = 1;
      if (($handle = fopen("books.csv", "r")) !== FALSE) {
          while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
              $num = count($data);
              $row++;
              for ($c=0; $c &lt; $num; $c++) {
                  echo $data[$c] . "&lt;br /&gt;\n";
              }
          }
          fclose($handle);
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/17Jpx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/17Jpx.png" alt="picture"></a></p>