title: Count variable PHP
body: <p>I have a list of holidays. If a holiday falls between my Week beginning date and week ending date then hours awarded would be 8. </p>
  
  <p>Problem I am having is I can display 8 hours  ( this is include file and the value is being displayed on another PHP document ) however if I have multiple holidays for a week it still only displays 8. I would like to display </p>
  
  <p>One Holiday would be 8 hours
  Two Holidays would be 16 Hours
  Three Holidays would be  32 hours</p>
  
  <p>and so on and so forth </p>
  
  <p>I was messing around with += it would work however it would display the total amount for every week</p>
  
  <p>Here is my code </p>
  
  <pre><code>&lt;?
  
  //Holiday List for 2015
  
  //Hours for Holiday
  
  $TestHol = "2015-03-17";
  $TestHol2 = "2015-03-16";
  $TestHol3 = "2015-03-06";
  $NY = "2015-01-01";
  $Mem = "2015-05-26";
  $V1 = "2015-06-27";
  $V2 = "2015-06-30";
  $V3 = "2015-07-01";
  $V4 = "2015-07-02";
  $V5 = "2015-07-03";
  $In = "2015-07-04";
  $Lab = "2015-09-01";
  $Thx = "2015-11-27";
  $ThxF = "2015-11-28";
  $Chev = "2015-12-24";
  $Ch = "2015-12-25";
  $V6 = "2015-12-29";
  $V7 = "2015-12-30";
  $V8 = "2015-12-31";
  
  $holhour = 0;
  
  if(($TestHol&gt;$WBDATE) &amp;&amp; ($TestHol&lt;$WEDATE)):
   $holhour = 8;
  elseif(($TestHol2&gt;$WBDATE) &amp;&amp; ($TestHol2&lt;$WEDATE)):
   $holhour = 8;
  elseif(($TestHol3&gt;$WBDATE) &amp;&amp; ($TestHol3&lt;$WEDATE)):
   $holhour = 8;  
  elseif(($NY&gt;$WBDATE) &amp;&amp; ($NY&lt;$WEDATE)):
   $holhour = 8;
  elseif(($Mem&gt;$WBDATE) &amp;&amp; ($Mem&lt;$WEDATE)):
   $holhour = 8;
  elseif(($V1&gt;$WBDATE) &amp;&amp; ($V2&lt;$WEDATE)):
   $holhour = 8;
  elseif(($V2&gt;$WBDATE) &amp;&amp; ($V2&lt;$WEDATE)):
   $holhour = 8;
  elseif(($V3&gt;$WBDATE) &amp;&amp; ($V3&lt;$WEDATE)):
   $holhour = 8;
  elseif(($V4&gt;$WBDATE) &amp;&amp; ($V4&lt;$WEDATE)):
   $holhour = 8;
  elseif(($V5&gt;$WBDATE) &amp;&amp; ($V5&lt;$WEDATE)):
   $holhour = 8;
  elseif(($In&gt;$WBDATE) &amp;&amp; ($In&lt;$WEDATE)):
   $holhour = 8;
  elseif(($Lab&gt;$WBDATE) &amp;&amp; ($Lab&lt;$WEDATE)):
   $holhour = 8;
  elseif(($Thx&gt;$WBDATE) &amp;&amp; ($Thx&lt;$WEDATE)):
   $holhour = 8;
  elseif(($ThxF&gt;$WBDATE) &amp;&amp; ($ThxF&lt;$WEDATE)):
   $holhour = 8;
  elseif(($Chev&gt;$WBDATE) &amp;&amp; ($Chev&lt;$WEDATE)):
   $holhour = 8;
  elseif(($Ch&gt;$WBDATE) &amp;&amp; ($Ch&lt;$WEDATE)):
   $holhour = 8;
  elseif(($V6&gt;$WBDATE) &amp;&amp; ($V6&lt;$WEDATE)):
   $holhour = 8;
  elseif(($V7l&gt;$WBDATE) &amp;&amp; ($V7&lt;$WEDATE)):
   $holhour = 8;
  elseif(($V8&gt;$WBDATE) &amp;&amp; ($V8&lt;$WEDATE)):
   $holhour = 8;
  else :
   $holhour = 0;
  endif; 
  
  
  
   ?&gt;
  </code></pre>