PHP即将到来的本月第一个星期五[关闭]

(Moved to Code Review, where this belongs).

I have an event recurring on the first friday of the month (at 7pm), and I need to output the date of the next first friday coming up.

This is the first bit of PHP I've written, and I was wondering if there is a better way to implement this? Server is running PHP 5.3

Here's what I wrote:

$d = strtotime('today');
$t = strtotime('first friday of this month');

if ($d > $t) {
  $ff = strtotime('first friday of next month');
  $ffn = date('M j', $ff);
  echo 'Friday, '.$ffn.' at 7pm';
} elseif ($d == $t) {
  echo 'Tonight at 7pm';
} else {
  $ff = strtotime('first friday of this month');
  $fft = date('M j', $ff);
  echo 'Friday, '.$fft.' at 7pm';
}

Confirmed working

$today  = new DateTime();
$this_months_friday = new DateTime('first friday of this month');
$next_months_friday = new DateTime('first friday of next month');
echo ($today < $this_months_friday) ? $this_months_friday->format('M j') : $next_months_friday->format('M j');