Nik Top Posted August 4, 2011 Share Posted August 4, 2011 hi i am having trouble putting a variable in strtotime() $num = "5"; $future=date("Y-m-d", strtotime('+$num day')); please help is there a way to put in a variable Link to comment https://forums.phpfreaks.com/topic/243863-variable-in-strtotime/ Share on other sites More sharing options...
Pikachu2000 Posted August 4, 2011 Share Posted August 4, 2011 Variables aren't interpolated withing single quoted strings. Use double quotes instead. $future=date("Y-m-d", strtotime("+$num day")); Link to comment https://forums.phpfreaks.com/topic/243863-variable-in-strtotime/#findComment-1252190 Share on other sites More sharing options...
Nik Top Posted August 4, 2011 Author Share Posted August 4, 2011 Thank you !!!! so much :D Link to comment https://forums.phpfreaks.com/topic/243863-variable-in-strtotime/#findComment-1252198 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.