lalnfl Posted November 12, 2010 Share Posted November 12, 2010 I have this php code: length is 15 , that is what it is coming out of the database $length = $get['length']; $time = date('Y-m-d', strtotime('+$length days')); But when I echo time it comes out with this result 1969-12-31 What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted November 12, 2010 Share Posted November 12, 2010 String encloseds in single quotes are not evaluated. Replace the single quotes with double quotes: <?php $time = date('Y-m-d', strtotime("+$length days")); ?> Ken Quote Link to comment Share on other sites More sharing options...
lalnfl Posted November 12, 2010 Author Share Posted November 12, 2010 String encloseds in single quotes are not evaluated. Replace the single quotes with double quotes: <?php $time = date('Y-m-d', strtotime("+$length days")); ?> Ken Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.