2014-11-21 35 views
0

我剛剛開始使用PHP,並且遇到了一些應該很容易解決的問題。在PHP中添加DIV中的日期

在這個腳本中,我想添加一個echo/print?該日期適用於DATE NEEDED部分腳本的其餘部分。

有人能告訴我如何在「DATE NEEDED」周圍添加div,並讓它顯示網站上的實際日期?

感謝您的幫助!

if (get_option('vh_time_format') == false || get_option('vh_time_format') == '24h') 
{ 
    $output .= '<li><div class="time icon-clock">' . $needed_info[0] 
      . '</div> DATE NEEDED <div class="ticket hover_right"><a href="' 
      . $new_button_link . '" class="icon-ticket">' . $new_button_text 
      . '</a></div><div class="event_auditory">' . __('Venue:', 'vh') 
      . $value['theatre'] . ', ' . $needed_info[1] . '</div></li>'; 
} 
else { (almost the same) } 

回答

1

隨着日期的功能:

$output .= '<li><div class="time icon-clock">'.$needed_info[0].'</div> <div>'.date("Y-m-d H:i:s").'</div> <div class="ticket hover_right"><a href="'.$new_button_link.'" class="icon-ticket">'.$new_button_text.'</a></div><div class="event_auditory">' . __('Venue:', 'vh') . $value['theatre'].', '.$needed_info[1].'</div></li>'; 
              div start, date, and div end ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
+0

真棒,謝謝回答!:) – maartentak 2014-11-21 15:44:22

+0

不客氣! – vaso123 2014-11-21 15:48:45

+0

不等待。這是今天的日期,但不是函數中其他地方使用的日期; ((($ value ['date'] == $ post_date && $ show_all!='1')||($ value ['date']> = $ post_date && $ show_all =='1')) ){等 我怎樣才能得到上面使用的日期? – maartentak 2014-11-21 16:50:58