亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

顯示特定日期的函數結果

顯示特定日期的函數結果

PHP
動漫人物 2023-12-15 15:47:18
我有這個功能function show_contents(){$post_id = 3135;$post_content = get_post($post_id);$content = $post_content->post_content;$content_final =  '<p style="line-height:1; color:white; font-family:Georgia, serif;">';apply_filters('the_content',$content);$content_final .= '</p>';return $content_final;}我想在星期一打印結果。對于打印我有這個代碼 date_default_timezone_set('Europe/Copenhagen'); $day = date("l"); if( $day == "Monday"){ show_contents();}但我在帖子中沒有看到我放置 XYZ Php 代碼插件的簡碼的內容。
查看完整描述

1 回答

?
阿晨1998

TA貢獻2037條經驗 獲得超6個贊

嘗試這個:


$day = date("l");


switch(date("N"))

{

 case 1: //Monday

 {

   show_contents(); break;

 }

 case 2: //Tuesday

 {

   // other function

   break;

 }


  // Add the other week days here if you nees (3,4,5 and 6)


 case 7: //Sunday

 {

   // other function

   break;

 }

  

}


查看完整回答
反對 回復 2023-12-15
  • 1 回答
  • 0 關注
  • 148 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號