0

Show current month all date. And the previous date fields disabled this is my code. I write the code correctly but its showing some error how can i fix this issue.

Parse error: syntax error, unexpected '"-"' (T_CONSTANT_ENCAPSED_STRING)

Any idea

<?php
for($i = 1; $i <=  date('t'); $i++)
{
   $dates[] = str_pad($i, 2, '0', STR_PAD_LEFT) "-"  date('m') . "-" . date('Y');
}
?>
<table border='1'>

<th>Date</th>
<th>Text</th>
<?php foreach($dates as $date) {?>
<tr>

    <td>
        <?php echo $date; ?>
    </td>

     <td><input type="text"></td>

</tr>
<?php } ?>
</table>
Madhumitha
  • 340
  • 5
  • 24

1 Answers1

-1
<?php
for($i = 1; $i <=  date('t'); $i++)
{
   $dates[] = str_pad($i, 2, '0', STR_PAD_LEFT). "-" . date('m') . "-" . date('Y');
}
?>
<table border='1'>

<th>Date</th>
<th>Text</th>
<?php foreach($dates as $date) {?>
<tr>

    <td>
        <?php echo $date; ?>
    </td>
    <?php
     if($date >= date("d-m-Y"))
     {
    ?>
    <td><input type="text"></td>
     <?php } else { ?>
     <td><input type="text" disabled></td>
     <?php } ?>
</tr>
<?php } ?>
</table>
Ramesh S
  • 841
  • 3
  • 15
  • 35