Count number of Sunday's in given Month and year
<p>I want output to be count of sunday's present in given month and year.</p>

<p><strong>This is my code:</strong></p>

<pre><code>$months=$_POST['month'];  
$years=$_POST['year'];                                      
$monthName = date("F", mktime(0, 0, 0, $months));
$fromdt=date('Y-m-01 ',strtotime("First Day Of  $monthName $years")) . '&lt;br/&gt;';
$todt=date('Y-m-d ',strtotime("Last Day of $monthName $years")) . '&lt;br/&gt;';

$num_sundays='';                
for ($i = 0; $i &lt; ((strtotime($todt) - strtotime($fromdt)) / 86400); $i++)
{
    if(date('l',strtotime($fromdt) + ($i * 86400)) == 'Sunday')
    {
            $num_sundays++;
    }
}
</code></pre>

<p>I am not getting any output if i echo $num_sundays. Please help me . I am new to PHP</p>