title: Using values as a validation check in laravel
body: <p>I have created a script which takes zip files apart and counts how many files are in that zip. For validation check, I need to use the <code>INT</code> that function puts out and do an if statement with it, how can I get this to work?</p>
  
  <pre><code>$zipFile = $request-&gt;file('fupload');
      $templatename = $request-&gt;input('template_name');
      $file_to_open = $request-&gt;file('fupload')-&gt;getRealPath();
      $target = storage_path();
  
      $zip = new \ZipArchive();
      if ($zip-&gt;open($file_to_open) == TRUE) {
  
          for ($i = 0; $i &lt; $zip-&gt;numFiles; $i++) {
              $filename = $zip-&gt;getNameIndex($i);
  
              if ( stristr($filename, '__MACOSX') === FALSE )
              {
                  $path_parts = pathinfo($filename);
  
                  if ( isset($path_parts['extension']) &amp;&amp; !isset( $this-&gt;extensions[$path_parts['extension']] ) )
                  {
                      $this-&gt;extensions[$path_parts['extension']] = 1;
                  } else if ( isset($path_parts['extension']) )
                  {
                      $this-&gt;extensions[$path_parts['extension']] = $this-&gt;extensions[$path_parts['extension']] + 1;
                  }
  
                  if ( isset($path_parts['extension']) &amp;&amp; ($path_parts['extension'] == 'html' || $path_parts['extension'] == 'htm' ) )
                  {
                      $this-&gt;html = $zip-&gt;getFromName($filename);
                      $this-&gt;files[] = (object) [ 'filename' =&gt; basename($filename), 'contents' =&gt; $zip-&gt;getFromName($filename)];
                  } else if ( isset($path_parts['extension']) ) {
                      $this-&gt;files[] = (object) [ 'filename' =&gt; basename($filename), 'contents' =&gt; $zip-&gt;getFromName($filename)];
                  }
              }
          }
          echo '&lt;pre&gt;';
          var_dump($templatename, $this-&gt;extensions);
          $this-&gt;validateZipfiles();
  
      }
      unlink($file_to_open);
  }
  </code></pre>