/    Sign up×
Community /Pin to ProfileBookmark

link expiry exception

Hi i have this exception but im not entierly sure whether its correct or its complete can someone check it also fill in the blanks with examples?

it’s to set a link to expire on a particular day

thanks

$now = time();

$expire = strtotime(‘2008-01-31 00:00:00’);

if ($expire < $golive) {

} else {

}

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@scragarDec 17.2007 — starting with the is_naked_day function from http://naked.dustindiaz.com/ I have a much easier solution, that's always going to work.
[code=php]function is_naked_day() {
$start = date('U', mktime(-12,0,0,04,05,date('Y')));
$end = date('U', mktime(36,0,0,04,05,date('Y')));
$z = date('Z') * -1;
$now = time() + $z;
if ( $now >= $start && $now <= $end ) {
return true;
}
return false;
}[/code]

and the edit's produce:
[code=php]function is_expired(){
$end = date('U', strtotime('2008-01-31 00:00:00'));
$z = date('Z') * -1;
$now = time() + $z;
if($now < $end ) {
return false;
}
return true;
}[/code]

tada. took about 30 seconds to make the edits.
×

Success!

Help @rbrown 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.18,
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,
)...