/    Sign up×
Community /Pin to ProfileBookmark

PHP Date – What am I doing wrong?

Ok, so here’s what I have… any idea where I’m going wrong? Because it’s not working.

[code=php]
<td><select name=”date_<?php echo($eli); ?>”><?php
$lastSaturday = strtotime(‘Saturday’);
$lasttime = strtotime(‘-30 days’, $lastSaturday);
for($ci=0;$ci<90;$ci++){
$oldTime=$lastTime;
if(($ci+1)==1){
$daysAhead=’+’.($ci+1).’ day’;
}else{
$daysAhead=’+’.($ci+1).’ days’;
}
$lastTime=strtotime($daysAhead,$oldTime);
?>
<option value=”<?php echo(date(‘m-d-Y’,$lasttime)); ?>”><?php echo(date(‘m/d/y’,$lasttime)); ?></option><?php
} ?></select></td>[/code]

It just gives me this for every single line:

[code=html]<option value=”03-29-2012″>03/29/12</option>[/code]

I’m going cross-eyed from all the coding I’ve been doing lately so I can’t spot my mistake(s)… Any help would be greatly appreciated.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 23.2012 — I think it's a letter case issue in your $last[B]T[/B]ime/$last[B]t[/B]ime variables.
×

Success!

Help @amandaNHT spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...