'How to echo a variable [duplicate]

I can't get the following to work, been trying ages now :(

Day: <input type="date" name="Day" value=""<?php $currentDate;?>"" /> 


Day: <input type="date" name="Day" value="2014-02-11" /> 

The second one works fine but the first one won't. Thanks



Solution 1:[1]

If you haven't yet defined the current date you can use:

Day: <input type="date" name="Day" value="<?=date('Y-m-d')?>" />

Otherwise:

Day: <input type="date" name="Day" value="<?=$currentDate?>" />

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1