Hello!

I have this:

<?php 
$next_friday = strtotime("next friday"); 

echo "<select>"; 
// If you want to loop for 8 weeks 
for ( $i=1; $i < 10; $i++ ) 
{ 
    echo "<option>".date("m-d-Y",strtotime("+{$i} week", $next_friday)); 
} 

echo "</select>"; 
?>

It shows every friday and but all together.

How would I modify this to show me ONLY every other friday. One date at a time and change as that date passes?

So for instance the next Friday would say "11-11-2011" and then after Nov 11th passed it would read "11-25-2011"

Thank you so much

Recommended Answers

All 2 Replies

Please make change your for loop to below post line:

for ( $i=0; $i < 1; $i++ )

this will only show you one upcoming Friday at a time. after going this Friday this will show you next Friday.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.